From 570901ba4e526be37afd0cbbe018cb0500a7cda1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 5 Sep 2011 01:22:27 -0400 Subject: Refactor a bit * move a lot of stuff out of MessageManager * move models from lib to models --- src/controllers/AuthPage.class.php | 1 + src/controllers/Messages.class.php | 9 +-- src/controllers/Plugins.class.php | 6 +- src/controllers/Users.class.php | 82 +++++++++++--------- src/lib/Auth.class.php | 110 --------------------------- src/lib/ContactMethod.class.php | 30 -------- src/lib/Database.class.php | 4 +- src/lib/Group.class.php | 23 ------ src/lib/Login.class.php | 2 + src/lib/MessageHandler.class.php | 49 ------------ src/lib/MessageManager.class.php | 14 ---- src/lib/Model.class.php | 3 - src/lib/PluginManager.class.php | 16 ++-- src/lib/SenderBroadcast.class.php | 7 -- src/lib/SenderPrivate.class.php | 7 -- src/lib/User.class.php | 25 ------ src/models/Auth.class.php | 130 ++++++++++++++++++++++++++++++++ src/models/ContactMethod.class.php | 30 ++++++++ src/models/Group.class.php | 23 ++++++ src/models/User.class.php | 25 ++++++ src/plugins/InformationPlugin.class.php | 2 + src/plugins/SenderGVSMS.class.php | 5 +- src/plugins/SenderIdentica.class.php | 5 +- src/views/Template.class.php | 12 +-- src/views/pages/plugins/index.html.php | 2 +- src/views/pages/users/500.html.php | 3 +- 26 files changed, 289 insertions(+), 336 deletions(-) delete mode 100644 src/lib/Auth.class.php delete mode 100644 src/lib/ContactMethod.class.php delete mode 100644 src/lib/Group.class.php delete mode 100644 src/lib/MessageHandler.class.php delete mode 100644 src/lib/Model.class.php delete mode 100644 src/lib/SenderBroadcast.class.php delete mode 100644 src/lib/SenderPrivate.class.php delete mode 100644 src/lib/User.class.php create mode 100644 src/models/Auth.class.php create mode 100644 src/models/ContactMethod.class.php create mode 100644 src/models/Group.class.php create mode 100644 src/models/User.class.php (limited to 'src') diff --git a/src/controllers/AuthPage.class.php b/src/controllers/AuthPage.class.php index 127bc1f..b31d938 100644 --- a/src/controllers/AuthPage.class.php +++ b/src/controllers/AuthPage.class.php @@ -1,4 +1,5 @@ isLoggedIn(); - if ($uid===false || !$mm->getAuthObj($uid)->isUser()) { + $uid = Login::isLoggedIn(); + if ($uid===false || !Auth::getObj($uid)->isUser()) { $this->http401($routed, $remainder); return; } @@ -94,7 +94,6 @@ class Messages extends Controller { } public function http401($routed, $remainder) { - global $mm; - $this->showView('messages/401', array('uid'=>$mm->isLoggedIn())); + $this->showView('messages/401', array('uid'=>Login::isLoggedIn())); } } \ No newline at end of file diff --git a/src/controllers/Plugins.class.php b/src/controllers/Plugins.class.php index 597cd19..40d3fc0 100644 --- a/src/controllers/Plugins.class.php +++ b/src/controllers/Plugins.class.php @@ -1,12 +1,12 @@ isLoggedIn(); - if ($uid===false || !$m->getAuthObj($uid)->isAdim()) { + $uid = Login::isLoggedIn(); + if ($uid===false || !Auth::getObj($uid)->isAdmin()) { $this->http401($routed, $remainder); return; } diff --git a/src/controllers/Users.class.php b/src/controllers/Users.class.php index 9781ab0..9674907 100644 --- a/src/controllers/Users.class.php +++ b/src/controllers/Users.class.php @@ -1,4 +1,6 @@ showView('users/new', $vars); - } - + + // Index Views /////////////////////////////////////////////// + public function index($routed, $remainder) { return $this->index_dir($routed, $remainder); } @@ -56,18 +49,32 @@ class Users extends Controller { $this->show_index($routed, $remainder); } + // Other Views /////////////////////////////////////////////// + /** + * Handle GETing the new user form. + * + * I would have named this `new', but that's a keyword. + */ + public function new_user($routed, $vars) { + // since there will never be a remainder to `users/new', we can + // use that parameter to pass in some data. + $this->showView('users/new', $vars); + } + public function individual($routed, $remainder) { $username = implode('/', $remainder); - global $mm; - $uid = $mm->getUID($username); - if ($mm->getStatus($uid)===3) $uid = false; // ignore groups. + global $mm; // also used for pluginmanager + $db = $mm->database(); + $uid = $db->getUID($username); + $user = Auth::getObj($uid); + + if ($user->isGroup()) $uid = false; // ignore groups. if ($uid===false) { $this->http404($routed, $remainder); } else { - $user = $mm->getAuthObj($uid); if (!$user->canRead()) { $this->http401($routed, $remainder); exit(); @@ -75,6 +82,7 @@ class Users extends Controller { $vars = array(); $method = $_SERVER['REQUEST_METHOD']; + switch ($method) { case 'PUT': $_POST = $_PUT; case 'POST': @@ -82,31 +90,32 @@ class Users extends Controller { if ($user->canEdit()) { $vars = $this->update_user($user); } - break; + break; } - + $config_options = array(); $mm->pluginManager()->callHook('userConfig', &$config_options); $vars['config_options'] = $config_options; $vars['user'] = $user; - $vars['groups'] = $mm->listGroupNames(); + $vars['groups'] = $db->listGroupNames(); require_once('ContactMethod.class.php'); $this->showView('users/individual', $vars); } } - public function http404($routed, $remainder) { + public function http404($routed, $rnemainder) { $username = implode('/', $remainder); $this->showView('users/404', array('username'=>$username)); } - + public function http401($routed, $remainder) { - global $mm; - $this->showView('users/401', array('uid'=>$mm->isLoggedIn())); + $this->showView('users/401', array('uid'=>Login::isLoggedIn())); } - + + // Other Functions /////////////////////////////////////////// + /** * This will parse POST data to create a new user. * If successfull it will show a message saying so. @@ -119,9 +128,10 @@ class Users extends Controller { @$vars['password1'] = $_POST['auth_password' ]; @$vars['password2'] = $_POST['auth_password_verify']; - global $mm; + global $mm; $db = $mm->database(); + $vars['errors'] = array(); - if ($mm->getUID($vars['username'])!==false) + if ($db->getUID($vars['username'])!==false) $vars['errors'][] = 'user exists'; if (in_array($vars['username'], $this->illegal_names)) $vars['errors'] = 'illegal name'; @@ -136,11 +146,11 @@ class Users extends Controller { } else { $username = $vars['username']; $passowrd = $vars['password1']; - $uid = $mm->addUser($username, $password); + $uid = $db->addUser($username, $password); if ($uid===false) { $this->showView('users/500'); } else { - $mm->login($username, $password); + Login::login($username, $password); $this->showView('users/created', array('username'=>$username)); } @@ -185,8 +195,8 @@ class Users extends Controller { } // Change information ////////////////////////////////////////// - global $mm; $config_options = array(); + global $mm; $mm->pluginManager()->callHook('userConfig', &$config_options); foreach ($config_options as $group=>$options) { @@ -244,9 +254,9 @@ class Users extends Controller { * This will show the user index. */ private function show_index($routed, $remainder) { - global $mm; + global $mm; $db = $mm->database(); - $logged_in_user = $mm->getAuthObj($mm->isLoggedIn()); + $logged_in_user = Auth::getObj(Login::isLoggedIn()); if (!$logged_in_user->isUser()) { $this->http401($routed, $remainder); exit(); @@ -255,9 +265,9 @@ class Users extends Controller { $vars = array(); $vars['attribs'] = $this->getIndexAttribs(); $vars['users'] = array(); - $uids = $mm->listUsers(); + $uids = $db->listUsers(); foreach ($uids as $uid) { - $user = $mm->getAuthObj($uid); + $user = Auth::getObj($uid); $vars['users'][$uid] = array(); foreach ($vars['attribs'] as $attrib) { $key = $attrib['key']; @@ -269,8 +279,7 @@ class Users extends Controller { } private function getConf($user, $key) { - global $mm; - $logged_in_user = $mm->getAuthObj($mm->isLoggedIn()); + $logged_in_user = Auth::getObj(Login::isLoggedIn()); $uid = $user->getUID(); $post_key = $key."[$uid]"; @$value = $_POST[$post_key]; @@ -301,8 +310,7 @@ class Users extends Controller { private function setConf($uid, $key, $value) { // So, this rocks because we don't have to check permissions, // the User object does that. - global $mm; - $user = $mm->getAuthObj($uid); + $user = Auth::getObj($uid); switch ($key) { case 'auth_name': diff --git a/src/lib/Auth.class.php b/src/lib/Auth.class.php deleted file mode 100644 index e49ebf7..0000000 --- a/src/lib/Auth.class.php +++ /dev/null @@ -1,110 +0,0 @@ -mm = $mm; - $this->uid = $uid; - } - public function getUID() { - return $this->uid; - } - - /**********************************************************************\ - * The 'auth' table. * - \**********************************************************************/ - - // Row Type //////////////////////////////////////////////////////////// - /** - * @return 0=unverified 1=user 2=admin 3=group - */ - protected function getType() { - $type = $this->mm->getStatus($this->uid); - return $type; - } - protected function setType($type) { - $logged_in_uid = $this->mm->isLoggedIn(); - $logged_in_obj = $this->mm->getAuthObj($logged_in_uid); - $is_admin = $logged_in_obj->isAdmin(); - if (!$is_admin) return false; - - return $this->mm->setStatus($this->uid, $type); - } - public function isUser() { - $type = $this->getType(); - return ($type===1) || ($type===2); - } - public function isAdmin() { - $type = $this->getType(); - return ($type===2); - } - public function isGroup() { - $type = $this->getType(); - return ($type===3); - } - public function setUser($is_user) { - $is_user = ($is_user?true:false); - if ($this->isUser() != $is_user) { - $this->setType($is_user?1:0); - } - } - public function setAdmin($is_admin) { - $is_admin = ($is_admin?true:false); - $is_user = $this->isUser(); - $this->setType($is_admin?2:($is_user?1:0)); - } - - // Permissions ///////////////////////////////////////////////////////// - public function canRead() { - $logged_in_uid = $this->mm->isLoggedIn(); - $is_me = ($logged_in_uid === $this->uid); - - $logged_in_obj = $this->mm->getAuthObj($logged_in_uid); - $is_user = $logged_in_obj->isUser(); - - return ($is_me || $is_user); - } - public function canEdit() { - $logged_in_uid = $this->mm->isLoggedIn(); - $is_me = ($logged_in_uid === $this->uid); - - $logged_in_obj = $this->mm->getAuthObj($logged_in_uid); - $is_admin = $logged_in_obj->isAdmin(); - - return ($is_me || $is_admin); - } - - // [user|group]name //////////////////////////////////////////////////// - public function getName() { - if (!$this->canRead()) return false; - return $this->mm->getUsername($this->uid); - } - public function setName($new_name) { - if (!$this->canEdit()) return false; - return $this->mm->setUsername($this->uid, $new_name); - } - - /**********************************************************************\ - * The 'users' table. * - \**********************************************************************/ - - public function getConf($setting) { - if (!$this->canRead()) return false; - return $this->mm->getUserConf($this->uid, $setting); - } - public function setConf($setting, $value) { - if (!$this->canEdit()) return false; - return $this->mm->setUserConf($this->uid, $setting, $value); - } - public function getConfArray($setting) { - $string = $this->getConf($setting); - return $this->mm->valueToArray($string); - } - public function setConfArray($setting, $list) { - $string = $this->mm->arrayToValue($list); - return $this->setConf($setting, $string); - } -} diff --git a/src/lib/ContactMethod.class.php b/src/lib/ContactMethod.class.php deleted file mode 100644 index b01e7d3..0000000 --- a/src/lib/ContactMethod.class.php +++ /dev/null @@ -1,30 +0,0 @@ -verb_slug = $verb_slug; - $this->addr_slug = $addr_slug; - $this->verb_text = $verb_text; - $this->addr_text = $addr_text; - - global $CONTACT_METHODS; - $CONTACT_METHODS[$verb_slug] = $this; - } - public function setHandler($handler) { - $this->handler = $handler; - } -} diff --git a/src/lib/Database.class.php b/src/lib/Database.class.php index 03c227f..b7e5bcd 100644 --- a/src/lib/Database.class.php +++ b/src/lib/Database.class.php @@ -381,7 +381,7 @@ class Database { * key-value store in the database. */ public static function arrayToValue($list) { - $out_list = $this->sanitizeArray($list); + $out_list = self::sanitizeArray($list); return ','.implode(',', $out_list).','; } /** @@ -389,7 +389,7 @@ class Database { */ public static function valueToArray($value) { $raw_list = explode(',', $value); - $out_list = $this->sanitizeArray($raw_list); + $out_list = self::sanitizeArray($raw_list); return $out_list; } diff --git a/src/lib/Group.class.php b/src/lib/Group.class.php deleted file mode 100644 index 96c5e2c..0000000 --- a/src/lib/Group.class.php +++ /dev/null @@ -1,23 +0,0 @@ -uid; - } - - /**********************************************************************\ - * The 'auth' table. * - \**********************************************************************/ - - /**********************************************************************\ - * The 'users' table. * - \**********************************************************************/ - - public function getMembers() { - return $this->mm->getUsersInGroup($this->getName()); - } -} diff --git a/src/lib/Login.class.php b/src/lib/Login.class.php index 26d11dd..14e3ecb 100644 --- a/src/lib/Login.class.php +++ b/src/lib/Login.class.php @@ -1,6 +1,8 @@ database()->getUID($username); diff --git a/src/lib/MessageHandler.class.php b/src/lib/MessageHandler.class.php deleted file mode 100644 index 1fa9faf..0000000 --- a/src/lib/MessageHandler.class.php +++ /dev/null @@ -1,49 +0,0 @@ - $type) { - $value = $m->getPluginConf($plugin, $param); - if ($value!==false) { - switch ($type) { - case 'text': - case 'password': - $value = "$value"; - break; - case 'int': - $value = (int)$value; - break; - } - $obj->configSet($param, $value); - } - } - return $obj; - } - public function main() { - global $BASE; - - $private_senders = array(); - $broadcast_senders = array(); - - $plugin_list = $m->getSysConf('plugins'); - $plugins = explode(',', $plugin_list); - foreach ($plugins as $plugin) { - require_once("$plugin.class.php"); - if (is_subclass_of($plugin, 'SenderPrivate')) { - $private_senders[] = $this->loadPlugin($plugin); - } - if (is_subclass_of($plugin, 'SenderBroadcast')) { - $broadcast_senders[] = $this->loadPlugin($plugin); - } - } - //foreach ($private_senders) - } -} \ No newline at end of file diff --git a/src/lib/MessageManager.class.php b/src/lib/MessageManager.class.php index 645643e..d327eb7 100644 --- a/src/lib/MessageManager.class.php +++ b/src/lib/MessageManager.class.php @@ -82,18 +82,4 @@ class MessageManager { } return $this->base; } - - public function getAuthObj($uid) { - if (!isset($this->users[$uid])) { - $is_group = ($this->database()->getStatus($uid)===3); - if ($is_group) { - require_once('Group.class.php'); - $this->users[$uid] = new Group($uid); - } else { - require_once('User.class.php'); - $this->users[$uid] = new User($uid); - } - } - return $this->users[$uid]; - } } diff --git a/src/lib/Model.class.php b/src/lib/Model.class.php deleted file mode 100644 index 523976e..0000000 --- a/src/lib/Model.class.php +++ /dev/null @@ -1,3 +0,0 @@ -database(); require_once("$plugin_name.class.php"); $obj = new $plugin_name; $params = call_user_func("$plugin_name::configList"); foreach ($params as $param => $type) { - $value = $mm->getPluginConf($plugin_name, $param); + $value = $db->getPluginConf($plugin_name, $param); if ($value!==false) { switch ($type) { case 'text': @@ -52,18 +52,18 @@ class PluginManager { * Return an array of enabled plugin names. */ public function getActivePlugins() { - global $mm; - $string = $mm->getSysConf('plugins'); - return $mm->valueToArray($string); + global $mm; $db = $mm->database(); + $string = $db->getSysConf('plugins'); + return $db->valueToArray($string); } /** * Set the enabled plugins. */ public function setActivePlugins($plugins) { - global $mm; - $string = $mm->arrayToValue($plugins); - return $mm->setSysConf('plugins', $string); + global $mm; $db = $mm->database(); + $string = $db->arrayToValue($plugins); + return $db->setSysConf('plugins', $string); } /** diff --git a/src/lib/SenderBroadcast.class.php b/src/lib/SenderBroadcast.class.php deleted file mode 100644 index 7510ff2..0000000 --- a/src/lib/SenderBroadcast.class.php +++ /dev/null @@ -1,7 +0,0 @@ -uid; - } - - /**********************************************************************\ - * The 'auth' table. * - \**********************************************************************/ - - public function setPassword($password) { - if (!$this->canEdit()) return false; - return $this->mm->setPassword($this->uid, $password); - } - - /**********************************************************************\ - * The 'users' table. * - \**********************************************************************/ - -} diff --git a/src/models/Auth.class.php b/src/models/Auth.class.php new file mode 100644 index 0000000..3aba0f3 --- /dev/null +++ b/src/models/Auth.class.php @@ -0,0 +1,130 @@ +database()->getStatus($uid)===3); + if ($is_group) { + require_once('Group.class.php'); + $obj = new Group($uid); + } else { + require_once('User.class.php'); + $obj = new User($uid); + } + self::$users[$uid] = $obj; + } + return self::$users[$uid]; + } + + protected $db = null; + protected $uid = false; + public function __construct($uid) { + global $mm; + $this->db = $mm->database(); + $this->uid = $uid; + } + public function getUID() { + return $this->uid; + } + + /**********************************************************************\ + * The 'auth' table. * + \**********************************************************************/ + + // Row Type //////////////////////////////////////////////////////////// + /** + * @return 0=unverified 1=user 2=admin 3=group + */ + protected function getType() { + $type = $this->db->getStatus($this->uid); + return $type; + } + protected function setType($type) { + $logged_in_uid = $this->db->isLoggedIn(); + $logged_in_obj = Auth::getObj($logged_in_uid); + $is_admin = $logged_in_obj->isAdmin(); + if (!$is_admin) return false; + + return $this->db->setStatus($this->uid, $type); + } + public function isUser() { + $type = $this->getType(); + return ($type===1) || ($type===2); + } + public function isAdmin() { + $type = $this->getType(); + return ($type===2); + } + public function isGroup() { + $type = $this->getType(); + return ($type===3); + } + public function setUser($is_user) { + $is_user = ($is_user?true:false); + if ($this->isUser() != $is_user) { + $this->setType($is_user?1:0); + } + } + public function setAdmin($is_admin) { + $is_admin = ($is_admin?true:false); + $is_user = $this->isUser(); + $this->setType($is_admin?2:($is_user?1:0)); + } + + // Permissions ///////////////////////////////////////////////////////// + public function canRead() { + $logged_in_uid = Login::isLoggedIn(); + $is_me = ($logged_in_uid === $this->uid); + + $logged_in_obj = Auth::getObj($logged_in_uid); + $is_user = $logged_in_obj->isUser(); + + return ($is_me || $is_user); + } + public function canEdit() { + $logged_in_uid = Login::isLoggedIn(); + $is_me = ($logged_in_uid === $this->uid); + + $logged_in_obj = Auth::getObj($logged_in_uid); + $is_admin = $logged_in_obj->isAdmin(); + + return ($is_me || $is_admin); + } + + // [user|group]name //////////////////////////////////////////////////// + public function getName() { + if (!$this->canRead()) return false; + return $this->db->getUsername($this->uid); + } + public function setName($new_name) { + if (!$this->canEdit()) return false; + return $this->db->setUsername($this->uid, $new_name); + } + + /**********************************************************************\ + * The 'users' table. * + \**********************************************************************/ + + public function getConf($setting) { + if (!$this->canRead()) return false; + return $this->db->getUserConf($this->uid, $setting); + } + public function setConf($setting, $value) { + if (!$this->canEdit()) return false; + return $this->db->setUserConf($this->uid, $setting, $value); + } + public function getConfArray($setting) { + $string = $this->getConf($setting); + return $this->db->valueToArray($string); + } + public function setConfArray($setting, $list) { + $string = $this->db->arrayToValue($list); + return $this->setConf($setting, $string); + } +} diff --git a/src/models/ContactMethod.class.php b/src/models/ContactMethod.class.php new file mode 100644 index 0000000..b01e7d3 --- /dev/null +++ b/src/models/ContactMethod.class.php @@ -0,0 +1,30 @@ +verb_slug = $verb_slug; + $this->addr_slug = $addr_slug; + $this->verb_text = $verb_text; + $this->addr_text = $addr_text; + + global $CONTACT_METHODS; + $CONTACT_METHODS[$verb_slug] = $this; + } + public function setHandler($handler) { + $this->handler = $handler; + } +} diff --git a/src/models/Group.class.php b/src/models/Group.class.php new file mode 100644 index 0000000..f981a4f --- /dev/null +++ b/src/models/Group.class.php @@ -0,0 +1,23 @@ +uid; + } + + /**********************************************************************\ + * The 'auth' table. * + \**********************************************************************/ + + /**********************************************************************\ + * The 'users' table. * + \**********************************************************************/ + + public function getMembers() { + return $this->db->getUsersInGroup($this->getName()); + } +} diff --git a/src/models/User.class.php b/src/models/User.class.php new file mode 100644 index 0000000..b6dbede --- /dev/null +++ b/src/models/User.class.php @@ -0,0 +1,25 @@ +uid; + } + + /**********************************************************************\ + * The 'auth' table. * + \**********************************************************************/ + + public function setPassword($password) { + if (!$this->canEdit()) return false; + return $this->db->setPassword($this->uid, $password); + } + + /**********************************************************************\ + * The 'users' table. * + \**********************************************************************/ + +} diff --git a/src/plugins/InformationPlugin.class.php b/src/plugins/InformationPlugin.class.php index 6a37370..0267ccf 100644 --- a/src/plugins/InformationPlugin.class.php +++ b/src/plugins/InformationPlugin.class.php @@ -22,4 +22,6 @@ class InformationPlugin extends Plugin { 'Why you want to be on the team', 'textarea'); } + public function sendPrivate($to, $id, $subject, $body) {} + public function sendBroadcast($id, $subject, $body) {} } diff --git a/src/plugins/SenderGVSMS.class.php b/src/plugins/SenderGVSMS.class.php index 90f9e69..7919007 100644 --- a/src/plugins/SenderGVSMS.class.php +++ b/src/plugins/SenderGVSMS.class.php @@ -1,9 +1,8 @@ '', 'password'=>'', 'length'=>160); @@ -23,7 +22,7 @@ class SenderGVSMS extends SenderPrivate { $this->config['password']); } - public function send($phoneNum, $id, $subject, $body) { + public function sendPrivate($phoneNum, $id, $subject, $body) { global $shorturl, $messenger; $url = $shorturl->get($messenger->id2url($id)); $maxlen = $this->config['length']-(strlen($url)+1); diff --git a/src/plugins/SenderIdentica.class.php b/src/plugins/SenderIdentica.class.php index ac62dc3..1e778f6 100644 --- a/src/plugins/SenderIdentica.class.php +++ b/src/plugins/SenderIdentica.class.php @@ -1,9 +1,8 @@ '', 'password'=>'', 'length'=>140); @@ -24,7 +23,7 @@ class SenderIdentica extends SenderBroadcast { $this->config['password']); } - public function send($id, $subject, $body) { + public function sendBroadcast($id, $subject, $body) { global $shorturl, $messenger; $url = $shorturl->get($messenger->id2url($id)); $maxlen = $this->config['length']-(strlen($url)+1); diff --git a/src/views/Template.class.php b/src/views/Template.class.php index 540e4fc..f57d5dc 100644 --- a/src/views/Template.class.php +++ b/src/views/Template.class.php @@ -1,10 +1,12 @@ base = $base_url; - $this->mm = $mm; + $this->db = $mm->database(); } public function setRet($ret) { @@ -109,11 +111,11 @@ class Template { echo $str; } public function header($title) { - $mm = $this->mm; - if ($mm==null) { + $db = $this->db; + if ($db==null) { $username = false; } else { - $username = $mm->getUsername($mm->isLoggedIn()); + $username = $db->getUsername(Login::isLoggedIn()); } $ret = $this->ret; diff --git a/src/views/pages/plugins/index.html.php b/src/views/pages/plugins/index.html.php index 0e14161..d62b555 100644 --- a/src/views/pages/plugins/index.html.php +++ b/src/views/pages/plugins/index.html.php @@ -2,4 +2,4 @@ $t = $VARS['template']; $t->header('Administrator Plugin Management'); -$t->openTag('form',array('method'=>'post','action'=>$m->baseUrl().plugins)); +$t->openTag('form',array('method'=>'post','action'=>$t->url('plugins'))); diff --git a/src/views/pages/users/500.html.php b/src/views/pages/users/500.html.php index 27038a4..f4f1c42 100644 --- a/src/views/pages/users/500.html.php +++ b/src/views/pages/users/500.html.php @@ -1,5 +1,6 @@ database(); $t->status('500 Internal Server Error'); $t->header('Unknown error'); @@ -9,5 +10,5 @@ $t->paragraph("An unknown error was encountered when creating ". "error is on our end. Sorry."); $t->paragraph("Here's a dump of the SQL error stack, it may ". "help us find the issue:"); -$t->tag('pre', array(), htmlentities($mm->mysql_error())); +$t->tag('pre', array(), htmlentities($db->mysql_error())); $t->footer(); -- cgit v1.2.3-2-g168b