summaryrefslogtreecommitdiff
path: root/src/controllers/Users.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/controllers/Users.class.php')
-rw-r--r--src/controllers/Users.class.php33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/controllers/Users.class.php b/src/controllers/Users.class.php
index 447a70f..9978ef8 100644
--- a/src/controllers/Users.class.php
+++ b/src/controllers/Users.class.php
@@ -2,6 +2,8 @@
require_once('Login.class.php');
require_once('Auth.class.php');
require_once('DB.class.php');
+require_once('PluginManager.class.php');
+require_once('Database.class.php');
Router::register('users/new' , 'Users', 'new_user');
Router::register('users/index', 'Users', 'index_file');
@@ -73,9 +75,8 @@ class Users extends Controller {
}
if (!isset($vars['errors'])) $vars['errors'] = array();
- global $mm;
- $pm = $mm->pluginManager();
- $db = $mm->database();
+ $db = Database::getInstance();
+ $pm = PluginManager::getInstance();
$vars['antispam_html'] = $pm->callHook('antispam_html');
$vars['userlist'] = $db->getSysConf('anon_userlist');
@@ -83,9 +84,8 @@ class Users extends Controller {
}
public function individual($routed, $remainder) {
- global $mm; // also used for pluginmanager
- $db = $mm->database();
- $pm = $mm->pluginManager();
+ $db = Database::getInstance();
+ $pm = PluginManager::getInstance();
$username = implode('/', $remainder);
if ($username == 'all') {
@@ -97,7 +97,7 @@ class Users extends Controller {
$vars = array();
if (count($uids)<2) {
- $user = Auth::getObj($uid);
+ $user = Auth::getInstance($uid);
if ($user->isGroup()) $uid = false; // ignore groups.
@@ -127,7 +127,7 @@ class Users extends Controller {
$vars['users'] = array();
foreach ($uids as $uid) {
- $vars['users'][] = Auth::getObj($uid);
+ $vars['users'][] = Auth::getInstance($uid);
}
$vars['username'] = $username;
$vars['config_options'] = $config_options;
@@ -155,9 +155,8 @@ class Users extends Controller {
* explained.
*/
private function create_user() {
- global $mm;
- $db = $mm->database();
- $pm = $mm->pluginManager();
+ $db = Database::getInstance();
+ $pm = PluginManager::getInstance();
$vars = array();
@$vars['username' ] = $_POST['auth_name'];
@@ -238,8 +237,8 @@ class Users extends Controller {
// Change information //////////////////////////////////////////
$config_options = array();
- global $mm;
- $mm->pluginManager()->callHook('userConfig', &$config_options);
+ $pm = PluginManager::getInstance();
+ $pm->callHook('userConfig', &$config_options);
foreach ($config_options as $group=>$options) {
foreach ($options as $option) {
@@ -311,9 +310,9 @@ class Users extends Controller {
* This will show the user index.
*/
private function show_index($routed, $remainder) {
- global $mm; $db = $mm->database();
+ $db = Database::getInstance();
- $logged_in_user = Auth::getObj(Login::isLoggedIn());
+ $logged_in_user = Auth::getInstance(Login::isLoggedIn());
$anon_userlist = $db->getSysConf('anon_userlist')=='true';
if (!$anon_userlist && !$logged_in_user->isUser()) {
$this->http401($routed, $remainder);
@@ -339,7 +338,7 @@ class Users extends Controller {
return array('key'=>$key, 'name'=>$name, 'type'=>$type);
}
private function getIndexAttribs() {
- $user = Auth::getObj(Login::isLoggedIn());
+ $user = Auth::getInstance(Login::isLoggedIn());
$attribs = array();
$attribs[] = $this->attrib('auth_uid', 'UID');
@@ -361,7 +360,7 @@ class Users extends Controller {
}
private function registrationOpen() {
- global $mm; $db = $mm->database();
+ $db = Database::getInstance();
$val = $db->getSysConf('registration_open');
switch ($val) {
case 'true': return true;