summaryrefslogtreecommitdiff
path: root/src/controllers/Users.class.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-10-27 19:51:48 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-10-27 19:51:48 -0400
commit2d7a47a99be783c1933af0b24978dc2bbdfe9350 (patch)
tree8eefffd8cf1f3db2ce6efcb8e50846c943e6df61 /src/controllers/Users.class.php
parentdb4376c0c1d5d2ea72696e6d73b469cb2dc30b91 (diff)
parent29a3ffb99435827d5a7ea6886ac22bd2ee18d593 (diff)
Merge branch 'master' into multiuser-viewmultiuser-view
Conflicts: src/controllers/Users.class.php
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 a1ad2fe..b75848f 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();
$usernames = implode('/', $remainder);
$uids = array();
@@ -100,7 +100,7 @@ class Users extends Controller {
$vars = array();
if (count($uids)<2) {
- $user = Auth::getObj($uids[0]);
+ $user = Auth::getInstance($uids[0]);
if ($user->isGroup()) $uid = false; // ignore groups.
@@ -130,7 +130,7 @@ class Users extends Controller {
$vars['users'] = array();
foreach ($uids as $uid) {
- $vars['users'][] = Auth::getObj($uid);
+ $vars['users'][] = Auth::getInstance($uid);
}
$vars['usernames'] = $usernames;
$vars['config_options'] = $config_options;
@@ -158,9 +158,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'];
@@ -241,8 +240,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) {
@@ -314,9 +313,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);
@@ -342,7 +341,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');
@@ -364,7 +363,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;