aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorCharles Krinke2008-02-18 03:14:31 +0000
committerCharles Krinke2008-02-18 03:14:31 +0000
commit3df36523cb8814b71b8327c19185d73075ee41dc (patch)
treec0204f72d5fbdc1764275a45e32bb4f816eecf19 /OpenSim
parentODE: Tired of floating above the ground after crossing a border? Boy have I ... (diff)
downloadopensim-SC_OLD-3df36523cb8814b71b8327c19185d73075ee41dc.zip
opensim-SC_OLD-3df36523cb8814b71b8327c19185d73075ee41dc.tar.gz
opensim-SC_OLD-3df36523cb8814b71b8327c19185d73075ee41dc.tar.bz2
opensim-SC_OLD-3df36523cb8814b71b8327c19185d73075ee41dc.tar.xz
Thank you very much, Hashbox for:
Changed the public IsAdministrator back to protected, now checks Config to see whether it is allowed to run or not. Defaults to false (not allowed). To use add the following to OpenSim.ini [LL-Functions] AllowosConsoleCommand=true
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs19
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs2
4 files changed, 21 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index 36f75d1..5958249 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment
74 m_scene.EventManager.TriggerPermissionError(user, reason); 74 m_scene.EventManager.TriggerPermissionError(user, reason);
75 } 75 }
76 76
77 public virtual bool IsAdministrator(LLUUID user) 77 protected virtual bool IsAdministrator(LLUUID user)
78 { 78 {
79 if (m_bypassPermissions) 79 if (m_bypassPermissions)
80 { 80 {
@@ -495,6 +495,11 @@ namespace OpenSim.Region.Environment
495 return IsAdministrator(user); 495 return IsAdministrator(user);
496 } 496 }
497 497
498 public virtual bool CanRunConsoleCommand(LLUUID user)
499 {
500 return IsAdministrator(user);
501 }
502
498 public virtual bool CanTerraform(LLUUID user, LLVector3 position) 503 public virtual bool CanTerraform(LLUUID user, LLVector3 position)
499 { 504 {
500 bool permission = false; 505 bool permission = false;
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs
index 088b985..7713490 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs
@@ -1865,7 +1865,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1865 m_LSL_Functions.osRegionNotice(msg); 1865 m_LSL_Functions.osRegionNotice(msg);
1866 } 1866 }
1867 1867
1868 public int osConsoleCommand(string Command) 1868 public bool osConsoleCommand(string Command)
1869 { 1869 {
1870 return m_LSL_Functions.osConsoleCommand(Command); 1870 return m_LSL_Functions.osConsoleCommand(Command);
1871 } 1871 }
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index a7d4ecf..c07f6d7 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -3676,14 +3676,21 @@ namespace OpenSim.Region.ScriptEngine.Common
3676 return LLUUID.Zero.ToString(); 3676 return LLUUID.Zero.ToString();
3677 } 3677 }
3678 3678
3679 public int osConsoleCommand(string Command) 3679 public bool osConsoleCommand(string Command)
3680 { 3680 {
3681 if (World.PermissionsMngr.IsAdministrator(m_host.OwnerID)) { 3681 m_host.AddScriptLPS(1);
3682 OpenSim.Framework.Console.MainConsole.Instance.RunCommand(Command); 3682 Nini.Config.IConfigSource config = new Nini.Config.IniConfigSource(Application.iniFilePath);
3683 return 1; 3683 if (config.Configs["LL-Functions"] == null)
3684 } else { 3684 config.AddConfig("LL-Functions");
3685 return 0; 3685
3686 if (config.Configs["LL-Functions"].GetBoolean("AllowosConsoleCommand", false)) {
3687 if (World.PermissionsMngr.CanRunConsoleCommand(m_host.OwnerID)) {
3688 OpenSim.Framework.Console.MainConsole.Instance.RunCommand(Command);
3689 return true;
3690 }
3691 return false;
3686 } 3692 }
3693 return false;
3687 } 3694 }
3688 3695
3689 private void NotImplemented(string Command) 3696 private void NotImplemented(string Command)
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
index 81478e0..0703523 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
@@ -641,6 +641,6 @@ namespace OpenSim.Region.ScriptEngine.Common
641 int osTerrainSetHeight(int x, int y, double val); 641 int osTerrainSetHeight(int x, int y, double val);
642 int osRegionRestart(double seconds); 642 int osRegionRestart(double seconds);
643 void osRegionNotice(string msg); 643 void osRegionNotice(string msg);
644 int osConsoleCommand(string Command); 644 bool osConsoleCommand(string Command);
645 } 645 }
646} 646}