public function loadClass($className, $classPath, $classFile = null, $loadAs = null) { // Clean variables are good variables, make sure to give your variables a wash at least once every time uncertain content is fed to it. $className = TextMan::cleanAlNum($className); $classPath = TextMan::cleanFilePath($classPath); $classFile = $classFile === null ? $className . '.php' : TextMan::cleanFilePath($classFile) . '.php'; // Does the file exist? If not, return false if (file_exists(KERNEL_PATH . '/' . $classPath . '/' . $classFile) === false) { return false; } // Grab the file! include KERNEL_PATH . '/' . $classPath . '/' . $classFile; // Does the class exist? If not, return false if (class_exists($className) === false) { return false; } $loadAs = $loadAs === null ? $className : $loadAs; // Load the class and run it then get out of here $this->_loadedClasses[$loadAs] = new $className($this); return true; }
private function _buildUserInfo() { $userid = TextMan::cleanAlNum(get_cookie_sane('userid')); $password = TextMan::cleanAlNum(get_cookie_sane('password')); if (empty($userid) === true or ctype_digit($userid) === false or empty($password) === true) { exit('Illegal function removal, this code should never be reached ever in the history of ever. Ever. <!-- ' . __LINE__ . ', ' . __FILE__ . ' -->'); } // Right o, no bad function removal, everything is clean, time to move on! $this->db->runSelect('users', '*', '`id` = \'' . $userid . '\' AND `password` = \'' . $password . '\''); $this->userInfo = $this->db->runSingleFetch(); unset($this->userInfo['hash']); //print_r($this->userInfo); }