summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/class/access.class.php34
-rw-r--r--lib/init.php2
-rw-r--r--lib/preferences.php2
3 files changed, 35 insertions, 3 deletions
diff --git a/lib/class/access.class.php b/lib/class/access.class.php
index 59289c7c..3e8331e3 100644
--- a/lib/class/access.class.php
+++ b/lib/class/access.class.php
@@ -181,13 +181,13 @@ class Access {
*/
case 'init-xml-rpc':
$sql = "SELECT `id` FROM `access_list`" .
- " WHERE `start` <= '$ip' AND `end` >= '$ip' AND `type`='xml-rpc' AND `level` >= '$level'";
+ " WHERE `start` <= '$ip' AND `end` >= '$ip' AND `type`='rpc' AND `level` >= '$level'";
break;
case 'rpc':
case 'xml-rpc':
$sql = "SELECT `id` FROM `access_list`" .
" WHERE `start` <= '$ip' AND `end` >= '$ip'" .
- " AND `key` = '$key' AND `level` >= '$level' AND (`type`='xml-rpc' OR `type`='rpc')";
+ " AND `key` = '$key' AND `level` >= '$level' AND `type`='rpc'";
break;
case 'network':
case 'interface':
@@ -216,6 +216,36 @@ class Access {
} // check_network
/**
+ * check_access
+ * This is the global 'has_access' function it can check for any 'type' of object
+ * everything uses the global 0,5,25,50,75,100 stuff. GLOBALS['user'] is always used
+ */
+ public static function check($type,$level) {
+
+ $level = intval($level);
+
+ // Switch on the type
+ switch ($type) {
+ case 'localplay':
+ // Check their localplay_level
+ if ($GLOBALS['user']->prefs['localplay_level'] >= $level) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ break;
+ default:
+ return false;
+ break;
+ } // end switch on type
+
+ // Default false
+ return false;
+
+ } // check
+
+ /**
* validate_type
* This cleans up and validates the specified type
*/
diff --git a/lib/init.php b/lib/init.php
index 0342b01f..4611e4f0 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -81,7 +81,7 @@ if (!count($results)) {
}
/** This is the version.... fluf nothing more... **/
-$results['version'] = '3.4-Alpha4 Build (003)';
+$results['version'] = '3.4-Alpha4 Build (004)';
$results['int_config_version'] = '6';
$results['raw_web_path'] = $results['web_path'];
diff --git a/lib/preferences.php b/lib/preferences.php
index 793b1db4..6a5b2bd5 100644
--- a/lib/preferences.php
+++ b/lib/preferences.php
@@ -263,9 +263,11 @@ function create_preference_input($name,$value) {
case 'localplay_level':
if ($value == '25') { $is_user = 'selected="selected"'; }
elseif ($value == '100') { $is_admin = 'selected="selected"'; }
+ elseif ($value == '50') { $is_manager = 'selected="selected"'; }
echo "<select name=\"$name\">\n";
echo "<option value=\"0\">" . _('Disabled') . "</option>\n";
echo "<option value=\"25\" $is_user>" . _('User') . "</option>\n";
+ echo "<option value=\"50\" $is_manager>" . _('Manager') . "</option>\n";
echo "<option value=\"100\" $is_admin>" . _('Admin') . "</option>\n";
echo "</select>\n";
break;