Exemple #1
0
 /**
  *@Description : constructor
  *
  *@return: constractor
  */
 public function __construct()
 {
     global $My_Lang;
     My_Kernel::loadLang('plugin', 'formAction');
     //load class language
     $this->lang =& $My_Lang->plugin['formAction'];
 }
Exemple #2
0
 /**
  *@Description : constructor
  *
  *@return: constractor
  */
 public function __construct($db)
 {
     global $My_Lang;
     My_Kernel::loadLang('class', 'page');
     //load class language
     if (is_object($db)) {
         $this->_db = $db;
     }
 }
Exemple #3
0
 /**
  *@Description : constructor
  *
  *@return: constractor
  */
 public function __construct($db)
 {
     global $My_Lang;
     global $My_Sql;
     $this->_SQL =& $My_Sql;
     My_Kernel::loadLang('module', 'news');
     //load class language
     parent::General($db);
 }
Exemple #4
0
 /**
  *@Description : constructor
  *
  *@return: constractor
  */
 public function __construct($db)
 {
     global $My_Lang;
     global $My_Sql;
     require_once dirname(__FILE__) . '/../news.sql.php';
     $this->_SQL =& $My_Sql;
     My_Kernel::loadLang('module', 'news');
     //load class language
     parent::General($db);
 }
Exemple #5
0
 /**
  *@Description : constructor
  *
  *@return: constractor
  */
 public function __construct(&$db)
 {
     global $My_Lang;
     My_Kernel::loadLang('class', 'menu');
     //load class language
     $this->_lang =& $My_Lang->class['menu'];
     if (is_object($db)) {
         $this->_db = $db;
     }
 }
Exemple #6
0
 /**
  *@Decription : load specify type database class
  *
  *@Param : string	database type
  *
  *@return: constructor
  */
 public function __construct(&$db)
 {
     global $_system;
     My_Kernel::loadLang('class', 'group');
     //load class language
     $this->_db = $db;
     if (isset($_system['db_int_seperator'])) {
         $this->_intSeparator = $_system['db_int_seperator'];
     }
 }
Exemple #7
0
 /**
  *@Description :
  *
  *@return: constractor
  */
 public function __construct($templaterName, $options = null)
 {
     My_Kernel::loadLang('class', 'templater');
     //load class language
     switch (strtolower($templaterName)) {
         case 'smarty':
         default:
             require_once dirname(__FILE__) . '/templates/MY_smarty.class.php';
             $this->_templater = new MY_smarty();
             if ($options) {
                 $this->setOptions($options);
             }
             break;
     }
 }
Exemple #8
0
 /**
  *@Description:    initialize user session
  *
  *@return: void
  */
 protected function _initUserSession($userInfo = array())
 {
     if (isset($_POST['user_name'], $_POST['user_password'], $_REQUEST['admin'], $_REQUEST['yemodule']) && 'login' == $_REQUEST['admin'] && 'system' == $_REQUEST['yemodule']) {
         $my_user = $this->getClass('user', $this->_systemDb);
         $checkLogin = $my_user->login($_POST['user_name'], $_POST['user_password']);
         //var_dump($_SESSION);
         //exit;
     }
     if (!isset($checkLogin) || $checkLogin > 0) {
         parent::_initUserSession();
     }
     $_SESSION['my_user']['theme'] = isset($_SESSION['my_user']['admin_theme']) ? $_SESSION['my_user']['admin_theme'] : 'kinful';
     if (intval($_SESSION['my_user']['system_user']) < 1 && intval($_SESSION['my_user']['super_admin']) < 1) {
         //$this->_setRequest(array('page'=>'login', 'module'=>''));
         //session_destroy();
         $this->redirect(MY_ROOT_URL . 'login.html');
         exit;
     }
     return $this;
 }
Exemple #9
0
 /**
  *@Decription : load specify type database class
  *
  *@Param : string	database type
  *@Param : int		which Db will be connected to
  *
  *@return: constractor
  */
 public function __construct()
 {
     My_Kernel::loadLang('class', 'html');
     //load class language
 }
Exemple #10
0
 public function __construct($className)
 {
     global $My_Lang;
     My_Kernel::loadLanguage('class', $className);
     //load class language
 }
Exemple #11
0
 /**
  *@Decription : user login
  *
  *@Param : user name
  *@Param : password
  *
  *@return: int (0: success; 1:user not exists; 2:password wrong)
  */
 public function login($username, $password)
 {
     if (($userInfo = $this->getUserByName($username)) === false) {
         return 1;
     }
     if ($userInfo['pwd'] !== My_Kernel::encryptString($password)) {
         return 2;
     }
     //load user information into session
     $this->_initUserSession($userInfo);
     return 0;
 }
Exemple #12
0
/*****                 @!!@                          ****/
/********************************************************/
/**
 *@FileName : index.php
 *@Author    : WangKilin
 *@Email    : wangkilin@126.com
 *@Date        : 2007-1-10
 *@Homepage    : http://www.kinful.com
 *@Version    : 0.1
 */
defined('Kinful') ? '' : define('Kinful', 1);
define('MY_ROOT_PATH', dirname(__FILE__) . '/');
// kinful system root path
define('MY_ROOT_URL', dirname($_SERVER['SCRIPT_NAME']) . '/');
function getMicroTime()
{
    $time = microtime();
    list($msec, $sec) = explode(" ", $time);
    return $sec . substr($msec, 2);
}
function getRunTime($start, $end)
{
    $spent = $end - $start;
    return sprintf("%.8f s", substr_replace(sprintf("%018s", $spent), '.', 10, 0));
}
$MY_START_TIME = getMicrotime();
require_once MY_ROOT_PATH . 'config/kinful.ini.php';
require_once MY_ROOT_PATH . 'class/My_Kernel.class.php';
$My_Kernel = new My_Kernel();
$My_Kernel->printPage();
/* EOF */
Exemple #13
0
 /**
  *@Description : get currently work dir content
  *
  *@return: array
  */
 public function getCwdContent()
 {
     global $My_Lang;
     if (!($dirHandler = @opendir($this->_cwd))) {
         $this->_errorStr = My_Kernel::createClassError($My_Lang->class['file']["readDirFailed"] . ": {$dirName}");
         return $false;
     }
     $dirContent = array();
     while ($itemInDir = readdir($dirHandler)) {
         if ($itemInDir == "." || $itemInDir == "..") {
             continue;
         }
         $dirContent[] = $itemInDir;
     }
     return $dirContent;
 }