/** * Simple Debug info * * @version 1.0 * @since 1.0.0 * @author Dan Aldridge * * @return void */ public function systeminfo() { $objSQL = Core_Classes_coreObj::getDBO(); $objTPL = Core_Classes_coreObj::getTPL(); $objTime = Core_Classes_coreObj::getTime(); $objForm = Core_Classes_coreObj::getForm(); $objTPL->set_filenames(array('body' => cmsROOT . Core_Classes_Page::$THEME_ROOT . 'block.tpl')); // checkers // grab some info about GD if (function_exists('gd_info')) { $a = gd_info(); $gdVer = preg_replace('/[[:alpha:][:space:]()]+/', '', $a['GD Version']); } else { $gdVer = 'Not Installed.'; } $info = '<div class="alert alert-info"><strong>Important!</strong> This panel needs more updating to output more useful data that has been made avaliable during the last overhaul</div>'; $content = 'This panel gives the CMS dev team some information about your setup. ;--System Setup CMS Version: ' . CMS_VERSION . ' PHP Version: ' . PHP_VERSION . ' (' . (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) == 'on' ? 'Safe Mode Enabled' : 'Safe Mode Disabled') . ') MySQL Version: ' . mysql_get_server_info() . ' GD Version: ' . $gdVer . ' ;--CMS Setup Install Path: /' . root() . ' ' . json_encode($objSQL->fetchAll('SELECT * FROM `#__config`')) . ''; Core_Classes_coreObj::getAdminCP()->setupBlock('body', array('cols' => 3, 'vars' => array('TITLE' => 'System Info', 'CONTENT' => $info . $objForm->textarea('sysInfo', $content, array('style' => 'width: 99%', 'rows' => 20)), 'ICON' => 'fa-icon-user'))); }
/** * Add a new user to the system * * @version 1.0 * @since 1.0.0 * @author Dan Aldridge * * @return void */ public function add() { $objSQL = Core_Classes_coreObj::getDBO(); $objTPL = Core_Classes_coreObj::getTPL(); $objTime = Core_Classes_coreObj::getTime(); Core_Classes_coreObj::getPage()->addBreadcrumbs(array(array('url' => doArgs('REQUEST_URI', '', $_SERVER), 'name' => 'Add User'))); $objTPL->set_filenames(array('body' => cmsROOT . Core_Classes_Page::$THEME_ROOT . 'block.tpl', 'panel' => cmsROOT . 'modules/core/views/admin/users/add.tpl')); $objTPL->parse('panel', false); Core_Classes_coreObj::getAdminCP()->setupBlock('body', array('cols' => 3, 'vars' => array('TITLE' => 'Add User', 'CONTENT' => $objTPL->get_html('panel', false), 'ICON' => 'faicon-user'))); }
/** * Checks whether the user has exceeded the login quota * * @version 1.0 * @since 1.0.0 * @author Daniel Noel-Davies * * @param bool $dontUpdate * * @return bool */ public function attemptsCheck($dontUpdate = false) { if ($this->onlineData['login_time'] >= time()) { return false; } elseif ($this->onlineData['login_attempts'] > $this->config('login', 'max_login_tries')) { if ($this->onlineData['login_time'] == '0') { $objSQL = Core_Classes_coreObj::getDBO(); $objTime = Core_Classes_coreObj::getTime(); $objUser = Core_Classes_coreObj::getUser(); $query = $objSQL->queryBuilder()->update('#__sessions')->set(array('login_time' => $objTime->mod_time(time(), 0, 15), 'login_attempts' => '0'))->where('sid', '=', $objUser->grab('userkey'))->build(); $objSQL->query($query); } return false; } if ($dontUpdate === true) { return true; } if ($this->userData['login_attempts'] >= $this->config('login', 'max_login_tries')) { if ($this->userData['login_attempts'] === $this->config('login', 'max_login_tries')) { //deactivate the users account Core_Classes_coreObj::getUser()->toggle($this->userData['id'], 'active', false); } return false; } return true; }