public function func_debugbox($params, &$smarty) { if (!lib::$debugboxshown) { return lib::debugbox(); } return ''; }
public function authenticate(user $user, $password) { if ($user->password == lib::makehashedpassword($user, $password)) { return true; } else { return false; } }
public function defaultaction() { if (!auth::isloggedin()) { lib::sendto('/login'); } else { $contacts = new contactscollection(lib::getitem('user')); $contacts->getwithdata(); echo view::show('contacts/browse', array('contacts' => $contacts)); } }
public function processadd() { $username = $_POST['username']; $password = $_POST['password']; $admin = $_POST['admin']; $user = new user(array('username' => $username)); if (!is_null($user->id)) { lib::seterror($username . ' is already in use'); lib::sendto('/users/add'); } $user->username = $username; $user->password = lib::makehashedpassword($user, $password); $user->admin = $admin; $user->save(); lib::sendto('/users'); }
public function views() { $a = func_get_args(); $a = join('/', $a); $re = '@\\.(' . join('|', $_SERVER['allowed_dynamic_media']) . ')$@'; if (!preg_match($re, $a)) { throw new HTTPNotFound(); } $this->content_type = lib::content_type_from_extension($a); if (!file_exists($this->view->template_dir . '/' . $a)) { $a .= ".tpl"; if (!file_exists($this->view->template_dir . '/' . $a)) { throw new HTTPNotFound(); } $this->tplprocess = true; } $this->viewname = $a; }
public function body() { global $dispatch; try { $dispatch->find_controller_class(array('errorpage')); $dispatch->create_controller(); ob_start(); $dispatch->render(); $output = ob_get_clean(); } catch (Exception $e) { lib::log_exception($e); # if there are any errors at all, fall back on simple error reporting $code = $this->getCode(); $msg = $this->getMessage(); $ss = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : ''; $ret = "<html><head><title>{$msg}</title></head><body><h1>{$code}</h1>{$msg}<hr/><em>{$ss}</em></body></html>"; return $ret; } return $output; }
/** * 登录验证 * @access public * @return json */ public function index() { session_start(); if ($_SESSION['manage']) { $this->message('', app_url('/home/index')); exit; } if ($this->post()) { if ($_POST['admincode'] == C('ADMIN_CODE')) { $model = lib::getinstance()->A('Admin\\Model', Null, 'Model'); $user = $this->post('user'); $password = md5($this->post('password')); $datetime = date('Y-m-d H:i:s', time()); $sql = "select * from @_manage where admin=:user and password=:password and status=1"; $re = $model->prepare($sql); $re->user = $user; $re->password = $password; $result = $re->execute()->fetch(); $manage_id = $result['id']; if ($result) { $_SESSION['manage'] = $_POST['user']; $_SESSION['power_id'] = $result['power_id']; $base_arr = lib::getinstance()->A('Admin\\Model\\base', Null, 'Model')->getOne(); $power_arr = Lib::getinstance()->A('Admin\\Model\\power', Null, 'Model')->getOne($_SESSION['power_id']); $_SESSION['power_name'] = $power_arr['name']; $_SESSION['base_name'] = $base_arr['name']; $sql = "update @_manage set datetime='{$datetime}' where id='{$manage_id}'"; $model->prepare($sql)->execute(); echo json_encode(array('status' => 'y')); exit; } else { echo json_encode(array('status' => 'n')); exit; } } else { echo json_encode(array('status' => 'c')); exit; } } $this->display('login.html'); }
private static function _actionSilentRegLoginCheck() { if (!isset(self::$session["reg-login-checktime"])) { self::$session["reg-login-checktime"] = 0; } $tm = time(); if ($tm - self::$session["reg-login-checktime"] < 2) { echo "{login:false,email:false,lmsg:false,emsg:false}"; return; } self::$session["reg-login-checktime"] = $tm; $login = self::$c->post(self::$class . "-reg-name"); $email = self::$c->post(self::$class . "-reg-email"); if (lib::mquotes_gpc()) { $login = @stripslashes($login); $email = @stripslashes($email); } $lmsg = ""; $lres = "false"; $emsg = ""; $eres = "false"; if (!lib::validStr("user", $login, 4, 32, true, "Логин", false)) { $lmsg = lib::getLastMsg(); } else { $r = db::q("SELECT `id` FROM " . db::tnm(self::$class) . " WHERE `user`='" . db::esc($login) . "'", false); if ($r && !db::rows($r)) { $lres = "true"; } } if (!lib::validEmail($email, false)) { $emsg = lib::getLastMsg(); } else { $r = db::q("SELECT `id` FROM " . db::tnm(self::$class) . " WHERE `email`='" . db::esc($email) . "'", false); if ($r && !db::rows($r)) { $eres = "true"; } } @header("Content-Type: application/json"); return "{login:"******",lmsg:" . $lmsg . ",email:" . $eres . ",emsg:" . $emsg . "}"; }
public function process() { $username = $_POST['username']; $password = $_POST['password']; if (empty($username)) { lib::seterror('Please enter a username.'); lib::sendto('/login'); } if (empty($password)) { lib::setitem('username', $username); lib::seterror('Please enter a password.'); lib::sendto('/login'); } $user = new user(array('username' => $username)); if (auth::authenticate($user, $password)) { lib::setitem('user', $user); lib::sendto(); } else { lib::setitem('username', $username); lib::seterror('Invalid username or password.'); lib::sendto('/login'); } }
<?php require 'init.php'; // database connection, etc /* Example for security require 'admin_sec.php'; // database connection, etc if ( ! admin_sec::verify_logged_on_state() ) { header("Location: login_page.php?expired=1"); exit; } */ // Additional PHP application logic goes here // The actual web page (script output) starts with requiring the common header lib::public_log_out();
$action = lib::getParameterFromRequest('action'); $poids_annexe_emballage = lib::getParameterFromRequest('poids_annexe_emballage'); $actif_annexe_emballage = lib::getParameterFromRequest('actif_annexe_emballage'); $epaisseur_annexe_emballage = lib::getParameterFromRequest('epaisseur_annexe_emballage'); $hauteur_annexe_emballage = lib::getParameterFromRequest('hauteur_annexe_emballage'); $id_annexe_emballage = lib::getParameterFromRequest('id_annexe_emballage'); $largeur_annexe_emballage = lib::getParameterFromRequest('largeur_annexe_emballage'); $liste_fta = lib::getParameterFromRequest('liste_fta'); $longueur_annexe_emballage = lib::getParameterFromRequest('longueur_annexe_emballage'); $nom_annexe_emballage_groupe = lib::getParameterFromRequest('nom_annexe_emballage_groupe'); $nom_fte_fournisseur = lib::getParameterFromRequest('nom_fte_fournisseur'); $nombre_couche_annexe_emballage = lib::getParameterFromRequest('nombre_couche_annexe_emballage'); $quantite_par_couche_annexe_emballage = lib::getParameterFromRequest('quantite_par_couche_annexe_emballage'); $reference_fournisseur_annexe_emballage = lib::getParameterFromRequest('reference_fournisseur_annexe_emballage'); $selection_groupe = lib::getParameterFromRequest('selection_groupe'); $selection_fournisseur = lib::getParameterFromRequest('selection_fournisseur'); /* ----------------- ACTION A TRAITER ----------------- ----------------------------------- Détermination de l'action en cours ----------------------------------- Cette page est appelée pour effectuer un traitement particulier en fonction de la variable "$action". Ensuite elle redirige le résultat vers une autre page. Le plus souvent, le traitement est délocalisé sous forme de fonction située dans le fichier "functions.php" */ switch ($action) { /*
const BLAH = "lala"; public static function bar() { echo "Tester\n"; } } $t = new Tester(); $t->foo; Tester::bar(); printf("%s\n", Tester::BLAH); /* When you declare a class, it is by default 'static'. You can access any method in that class using the :: operator, and in any scope. This means if I create a lib class, I can access it wherever I want and it doesn't need to be globaled: */ class lib { static function foo() { echo "Hello\n"; } } lib::foo(); /* Now, when you create an instance of this class by using the new keyword, you use -> to access methods and values, because you are referring to that specific instance of the class. You can think of -> as inside of. (Note, you must remove the static keyword) IE: */ class lib2 { function foo() { echo "Hello2\n"; } } $class = new lib2(); $class->foo();
<?php // configuration require "../includes/config.php"; if (isset($_GET["username"])) { // query database for user $rows = Lib::query("SELECT * FROM users WHERE username = ? AND active = 0", $_GET["username"]); // if we found user, check password if (count($rows) == 1) { $token = md5(uniqid(rand(), true)); $message = '<html><head><title>Email Verification</title></head><body>'; $message .= '<p>Welcome to The Network. <a href="http://' . $_SERVER["HTTP_HOST"] . '/activate.php?token=' . $token . '">Click here to activate your account</a>.</p>'; $message .= '<p><i>If you do not know what this email is for just ignore it.</i></p>'; $message .= "</body></html>"; $sent = lib::sendEmail($rows[0]["email"], "The Network Verification", $message); if ($sent) { Lib::query("UPDATE users SET token = ? WHERE username = ?", $token, $_GET["username"]); alert("Email sent. Please check your email and click the link to activate", "success"); } } }
private static function _actionSilentNodePubs() { $res = "{res:"; $pubs = array(); $mods = self::modsListAll(array("id", "class", "core"), array(array(0 => "act", "type" => "ttt", 2 => "1", "="), array("name" => "core", "type" => "", 2 => "0", "="))); $pattern = "/.*public *static *function *" . self::$class . "(.*)\\(/"; foreach ($mods as $key => $mod) { $file = FLEX_APP_DIR_MOD . "/class." . $mod["class"] . "/" . $mod["class"] . ".php"; if (!@file_exists($file)) { continue; } $fp = @fopen($file, "r"); if ($fp === false) { continue; } $funcs = array(); while (!@feof($fp)) { $line = @fgets($fp); if ($line === false) { break; } @preg_match($pattern, $line, $m); if (count($m)) { $funcs[] = self::$class . trim($m[1]); } } @fclose($fp); if (count($funcs)) { foreach ($funcs as $key => $name) { $funcs[$key] = trim($name); } $pubs[] = array("class" => $mod["class"], "methods" => $funcs); } } $res = array("res" => true, "msg" => "", "pubs" => $pubs); $res = lib::jsonMake($res); echo $res; }
{ } } try { $dispatch = new Dispatch(); $dispatch->parse_request(); $dispatch->invoke_form_handler(); $dispatch->find_controller_class(); $dispatch->create_controller(); $dispatch->render(); } catch (HTTPException $e) { header("HTTP/1.1 " . $e->getCode() . ' ' . $e->getMessage()); header("Content-type: text/html"); if ($loc = $e->location()) { header("Location: {$loc}"); } print $e->body(); print lib::debugbox(); } catch (DataException $e) { header("HTTP/1.1 404 Data Exception"); if ($j = $e->value()) { $json = new JSON(); $j = $json->encode($j); header("X-JSON: {$j}"); } print $e->body(); } catch (Exception $e) { header("HTTP/1.1 500 Internal Error"); lib::log_exception($e); print lib::debugbox(); }
/** * Load a class definition * * @param string $className The className to load * @return true If success * @throws nExecption If the file isn't find */ public static function load($className) { if (!class_exists($className) && !in_array($className, self::$loadedClass)) { if (!array_key_exists($className, self::$loadFiles)) { if ($file = file::nyroExists(array('name' => $className))) { require $file; self::$loadFiles[$className] = array($file); self::$saveCacheLoad = true; self::$loadedClass[] = $className; if (defined('RUNKIT_VERSION')) { $filesExtend = file::nyroExists(array('name' => $className, 'type' => 'extend', 'rtl' => false, 'list' => true)); if (!empty($filesExtend)) { self::$loadFiles[$className][1] = $filesExtend; foreach ($filesExtend as $fe) { runkit_import($fe); } } } } else { if (!lib::load($className)) { if (self::$throwOnLoad) { throw new nException('Factory - load: Unable to find the file for ' . $className . '.'); } else { return false; } } } } else { require self::$loadFiles[$className][0]; self::$loadedClass[] = $className; if (defined('RUNKIT_VERSION') && array_key_exists(1, self::$loadFiles[$className])) { foreach (self::$loadFiles[$className][1] as $fe) { runkit_import($fe); } } } } return true; }
<div id="loginbox"> <h1>Login</h1> <?php echo view::show('standard/errors'); ?> <form action="/login/process" method="post"> <div class="row"><label for="username">Username:</label><input type="text" name="username" id="username" value="<?php echo lib::getitem('username'); ?> " /></div> <div class="row"><label for="password">Password:</label><input type="password" name="password" id="password" /></div> <div class="row"><label for="submit"> </label><input id="submit" type="submit" value="login" class="submitbutton" /></div> </form> </div>
public static function isadmin() { return self::isloggedin() && 1 == lib::getitem('user')->admin; }
} $guild_Data = ORM::for_table('guild')->where("id", $vs_Data->op_id)->find_one(); $ret["op_id"] = $guild_Data->id; $ret["op_name"] = $guild_Data->name; //グラフ用表示時間配列算出ループ for ($i = strtotime($t->FROM_TIME); $i <= strtotime($t->TO_TIME); $i = strtotime(date("Y-m-d H:i:s", $i) . " +5 min")) { $time[] = date("H:i", $i); } $point = ORM::for_table('ave_data')->where_equal("vs_id", $t->VS_ID)->where_gte("data_time", $t->FROM_TIME)->where_lte("data_time", $t->TO_TIME)->order_by_asc("data_time")->find_array(); if (count($point) == 0) { $ret['is_null'] = '1'; echo json_encode($ret); return $ret; } foreach ($point as $v) { $t = date("H:i", strtotime($v['data_time'])); $my[$t] = $v['my_data']; $op[$t] = $v['op_data']; } //最終投入データ取得 $last = ORM::for_table('min_data')->where_equal("vs_id", $t->VS_ID)->order_by_DESC("data_time")->find_one(); $ret['my_last'] = $last['my_data']; $ret['op_last'] = $last['op_data']; //未入力情報算出 $tm = lib::notDataUpdate($time, $my, $op); $gD = new graphData($tm['time']); $gD->setSeries($MI_GUILD_NAME, $tm['my']); $gD->setSeries($guild_Data->name, $tm['op']); $ret = array_merge($ret, $gD->getviewData()); echo json_encode($ret); return true;
/** * Выполняет запрос к БД * * @param string $q - строка запроса * @param boolean $die - прервать работу приложения * @param array $debug - перезапись параметров стека отладки * @return resource */ public static function q($q,$die=false,$debug=array("msg"=>"Ошибка выполнения запроса к БД.")) { $r=@mysql_query($q); if($r===false) { $sql="SQL запрос: [".lib::jsonPrepare($q)."]."; $raw="Ответ MySQL: [".lib::jsonPrepare(@mysql_error(self::$db["link"]))."]."; if(@function_exists("error_log") || $die) { //сохраняем if(!isset($debug["msg"]))$debug["msg"]="Ошибка выполнения запроса к БД."; if(!isset($debug["class"]))$debug["class"]=""; if(!isset($debug["func"]))$debug["func"]=""; if(!isset($debug["line"]))$debug["line"]=""; if(!$debug["class"] || !$debug["func"] || !$debug["line"]) { if(@function_exists("debug_backtrace")) { $dbg=@debug_backtrace(); if(!$debug["line"])$debug["line"]=$dbg[0]["line"]; @array_shift($dbg); if(!$debug["class"])$debug["class"]=isset($dbg[0]["class"])?$dbg[0]["class"]:""; if(!$debug["func"])$debug["func"]=isset($dbg[0]["function"])?$dbg[0]["function"]:""; } } self::$lastError=$debug["msg"]; self::$lastErrorId=msgr::errorLog($debug["msg"],false,$debug["class"],$debug["func"],$debug["line"],$sql." ".$raw); $ep="EP: [".($debug["class"]?($debug["class"]."::"):"").($debug["func"]?($debug["func"].">"):"").$debug["line"]."]"; if(@function_exists("error_log")) { $amail=self::$c->config("","adminEmail"); if(lib::validEmail($amail,false))@error_log($debug["msg"]."\n\n".$sql."\n\n".$raw."\n\n".$ep,1,$amail); } if($die)die($debug["msg"]."<br /><br />".$ep); } self::$counts[1]++; } else self::$counts[0]++; return $r; }
public function processdelete() { $controller = lib::getitem('controller'); if (empty($controller->params[0])) { lib::sendto(); } else { $connection = db::factory('mysql'); $contactid = (int) $controller->params[0]; $sql = "delete c.*, g.*, m.* from contact c\r\n left join contactgroup g on g.contactid=c.id\r\n left join contactmethod m on g.id=m.contactgroupid\r\n where c.id={$contactid}\r\n "; $results = $connection->execute($sql); lib::sendto(); } }
define('PASS', ''); define('DBNAME', 'admin_masterapk'); //define('USER','root'); //define('PASS','admin'); //define('DBNAME','2015_etc'); // //require_once( ROOT.'../wp-admin/admin.php' ); include "inc/db.php"; include "inc/lib.php"; include "inc/simple_html_dom.php"; include "inc/function_string.php"; include "inc/resize-class.php"; include "inc/libimg.php"; include "inc/img.php"; $img = new img(); $lib = new lib(); $db = new db(); $catid = (int) $_GET['term_id']; $ar_cat = $lib->ar_cat_string($catid); $total_no_active1 = $lib->get_num_link_no_active($ar_cat); $total_no_active = $total_no_active1; $total_active = $lib->get_num_link_active($ar_cat); $total_link = $total_active + $total_no_active; $phantram = round($total_active * 100 / $total_link, 1); $_SESSION['total'] = $total_link; $_SESSION['da_thuc_hien'] = $total_active; $_SESSION['chua_thuc_hien'] = $total_no_active; $_SESSION['con_lai'] = $total_link - $total_active; $_SESSION['phan_tram'] = $phantram; $data['chua_thuc_hien'] = $total_no_active; $data['phantram'] = $phantram;
public function defaultaction() { lib::setitem('user', NULL); lib::sendto(); }
public static function create($class,$file,$values,$bind=false) { //проверка модуля if(!$class || !class_exists(__NAMESPACE__."\\".$class)) { $msg="Указанный модуль [".$class."] отсутствует в системе."; if(!self::$silent)msgr::add($msg,MSGR_TYPE_ERR); else msgr::errorLog($msg,false,self::$class,__FUNCTION__,__LINE__); return false; } $modId=self::$c->modId($class); if(!$modId) { $msg="Указанный модуль [".$class."] не зарегистрирован в системе."; if(!self::$silent)msgr::add($msg,MSGR_TYPE_ERR); else msgr::errorLog($msg,false,self::$class,__FUNCTION__,__LINE__); return false; } //content type $is_image=false; $mime_from_ext=false; $sz=false; if(@function_exists("mime_content_type"))$ctp=@mime_content_type($file["tmp_name"]); elseif(@function_exists("finfo_file")) { $finfo=@finfo_open(FILEINFO_MIME); $ctp=@finfo_file($finfo,$file["tmp_name"]); @finfo_close($finfo); } else { $ctp=lib::MIMEType($file["name"]); $mime_from_ext=true; } //окончательная проверка на content type if($mime_from_ext) { $sz=@getimagesize($file["tmp_name"]); if($sz===false)$is_image=false; else { $ctp=$sz["mime"]; $is_image=true; } } else $is_image=(@strpos($ctp,"image")===0); if(strlen($ctp)>128)$ctp=substr($ctp,0,128); //image size $szW=0; $szH=0; if($is_image) { if(!$sz)$sz=@getimagesize($file["tmp_name"]); $szW=$sz[0]; $szH=$sz[1]; } else $nameSized=0; //file size $fsize=@filesize($file["tmp_name"]); //оригинальное имя файла $name=mb_strtolower($file["name"],"UTF-8"); //расширение файла $ext=explode(".",$name); $name=$ext[0]; if(count($ext)<2)$ext=""; else $ext=$ext[count($ext)-1]; //дата $dt=time(); $dtSQL=lib::dt($dt,true); $values["id"]="NULL"; $values["pid"]=0; $values["uid"]=self::$uid; $values["mid"]=$modId; $values["width"]=$szW; $values["height"]=$szH; $values["bytes"]=$fsize; $values["uploaded"]=$dtSQL; $values["type"]=self::_imgExt2Type($ext); $values["extension"]=$ext; $values["name_orig"]=$file["name"]; $values["content_type"]=$ctp; //проверяем пользовательские данные //"name_id","name_sized","size_delim","name","title","credit" foreach(self::$fieldsReq as $field) { switch($field) { case "directory": $owner=true; if(!isset($values["directory"]) || !$values["directory"]) { if($bind!==false && isset($bind["oid"]))$dir="".$bind["oid"]; else $dir=self::$config["dirShared"]; $owner=false; } else $dir=$values["directory"]; $values["directory"]=FLEX_APP_DIR_DAT."/_".$class."/".$dir.($owner?("/".self::$config["dirOwner"]):""); break; case "name_id": case "name_sized": $values[$field]=(0+$values[$field])?1:0; break; } } if(!$values["name"])$values["name_id"]=1; if($bind!==false) { if(!is_array($bind) || !count($bind)) { $msg="Неверные параметры байндинга."; if(!self::$silent)msgr::add($msg,MSGR_TYPE_ERR); else msgr::errorLog($msg,false,self::$class,__FUNCTION__,__LINE__); return false; } } //регистрируем файл $item=self::_write($values,$bind,MEDIA_WRITEMODE_INSERT); if($item===false)return false; $nameId=$item["name_id"]; $nameSized=$item["name_sized"]; $sizeDelim=$item["size_delim"]; $name=$item["name"]; $dir=$item["directory"]; //проверяем папки на доступ if(!@file_exists($dir)) { @mkdir($dir,0755,true); if(!@file_exists($dir)) { self::_delete($item["id"]); $msg="Медиа-директория недоступна для записи!"; if(!self::$silent)msgr::add($msg,MSGR_TYPE_ERR); else msgr::errorLog($msg,false,self::$class,__FUNCTION__,__LINE__,"Media directory is not writeable: [".$dir."]"); return false; } } else { if(!@is_dir($dir)) { self::_delete($item["id"]); $msg="Медиа-директория недоступна (имя занято файловым объектом)!"; if(!self::$silent)msgr::add($msg,MSGR_TYPE_ERR); else msgr::errorLog($msg,false,self::$class,__FUNCTION__,__LINE__,"Media thumbs directory name is already taken by file-object: [".$dir."]"); return false; } } //проверяем на перезапись файл $filename=($name?(($nameId?($item["id"].$sizeDelim):"").$name):$item["id"]).($is_image?($nameSized?($sizeDelim.$szW."x".$szH):""):"").".".$ext; if(@file_exists($dir."/".$filename)) { self::_delete($item["id"]); $msg="Файл с данным именем [".$dir."/".$filename."] уже существует!"; if(!self::$silent)msgr::add($msg,MSGR_TYPE_ERR); else msgr::errorLog($msg,false,self::$class,__FUNCTION__,__LINE__,"Destination file already exists: [".$dir."/".$filename."]"); return false; } //перемещаем файл @copy($file["tmp_name"],$dir."/".$filename); if(!@file_exists($dir."/".$filename)) { self::_delete($item["id"]); $msg="Невозможно переместить файл в запрошенную директорию!"; if(!self::$silent)msgr::add($msg,MSGR_TYPE_ERR); else msgr::errorLog($msg,false,self::$class,__FUNCTION__,__LINE__,"Destination file is not writeable: [".$dir."/".$filename."]"); return false; } else @chmod($dir."/".$filename,0755); $item["filename"]=$filename; $item["file_path"]=$dir."/".$filename; $item["url"]=FLEX_APP_DIR_ROOT.$item["file_path"]; //проверка папки иконок if($is_image) { $item["url_thumb"]=self::_thumb($item,self::$config["uploaderThumbExt"],self::$config["uploaderThumbSize"],$item["file_path"]); if($item["url_thumb"]===false)$item["url_thumb"]=FLEX_APP_DIR_DAT."/_".self::$class."/".self::$config["thumbsDir"]."/thumb-error.gif"; } return $item; }
private static function _html1Header() { $ent="".lib::rnd(1000000000, 2147483647); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title><?php echo self::$c->config("", "siteName"); ?> - <?php echo content::title(false, false); ?> </title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="author" content="Bogdan Nazar (info@itechserv.ru)" /> <meta name="generator" content="FlexEngine <?php echo self::$c->version(true); ?> (http://flexengine.ru)" /> <meta name="description" content="<?php echo content::item("meta_desc"); ?> " /> <meta name="keywords" content="<?php echo content::item("meta_kw"); ?> " /><? self::_metas(); if(file_exists("favicon.ico")):?> <link rel="shortcut icon" type="image/ico" href="/favicon.ico" /><?endif; self::_clientStyles();?> <script type="text/javascript"> var flex_engine_render_pointer<?php echo $ent; ?> = {cfg: { appName: (""<?php echo " + \"" . self::$c->config("", "siteName") . "\""; ?> ), appRoot: (""<?php echo " + \"" . FLEX_APP_DIR_ROOT . "\""; ?> ), elNameAction: (""<?php echo " + \"" . self::$c->config("", "elNameAction") . "\""; ?> ), elNameForm: (""<?php echo " + \"" . self::$c->config("", "elNameForm") . "\""; ?> ), entity: (""<?php echo " + \"" . $ent . "\""; ?> ), lang: (""<?php echo " + \"" . self::$c->lang() . "\""; ?> ), pageAlias: (""<?php echo " + \"" . content::item("alias") . "\""; ?> ), pageTemplate: (""<?php echo " + \"" . self::$c->template() . "\""; ?> ), pageTitle: (""<?php echo " + \"" . content::title(false, false) . "\""; ?> ), plugins: [] }}; </script><?self::_client();?> </head> <body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0"><? self::_spot(4,true,false,false,true); }
<?php /** * Created by PhpStorm. * User: Administrator * Date: 2015/12/11 * Time: 14:28 */ require 'includes/autoloader.php'; require 'includes/exceptions.php'; session_start(); $view = new view(); lib::setitem('controller', new controller($_GET['u'])); lib::getitem('controller')->render(); $content = $view->finish(); echo view::show('shell', array('body' => $content));
} else { $rows = Lib::query("SELECT * FROM users WHERE username = ?", $_POST["username"]); if (count($rows) != 0) { echo "Username already exits."; exit; } $rows = Lib::query("SELECT * FROM users WHERE email = ?", $_POST["email"]); if (count($rows) != 0) { echo "An account already exists with this email."; exit; } $token = md5(uniqid(rand(), true)); $message = '<html><head><title>Email Verification</title></head><body>'; $message .= '<p>Welcome to The Network. <a href="http://' . $_SERVER["HTTP_HOST"] . '/activate.php?token=' . $token . '">Click here to activate your account</a>.</p>'; $message .= '<p><i>If you do not know what this email is for just ignore it.</i></p>'; $message .= "</body></html>"; $sent = lib::sendEmail($_POST["email"], "The Network Verification", $message); if ($sent === true) { //registration complete Lib::query("INSERT IGNORE INTO users (username, hash, email, token) VALUES(?, ?, ?, ?)", $_POST["username"], password_hash($_POST["password"], PASSWORD_DEFAULT), $_POST["email"], $token); echo "OK"; } else { echo "Verification email could not be sent. Please double check your email and try again."; } } } } } } } }
public function __construct() { parent::__construct(); $this->page(); $this->{$this->page}(); }
/** * 获取内容并输出 * 如果stroage里面不存在,则从URL里面获取 * */ private function handle($filename, $key, $delete = false, $direct = false) { $content = ''; if ($this->succeed) { $storage = storage::gethandle(); if ($delete) { if (!$storage->exists($key)) { die(json_encode(array('purge' => $filename, 'key' => $key, 'success' => 'not exists'))); } $return = $storage->delete($key); die(json_encode(array('purge' => $filename, 'key' => $key, 'success' => $return))); } if ($storage->exists($key) && !$direct) { if (!NO_LOCATE && ($url = $storage->url($key))) { $this->locate($url); } $content = $storage->read($key); $this->hit = $key; if (empty($content)) { $this->succeed = false; $this->error_type = 'empty_conent'; } } else { //$content = @file_get_contents(BASE_URL.$filename); $content = lib::fetch_url(BASE_URL . $filename); if (!is_array($content) || count($content) < 2) { $this->succeed = false; $this->error_type = 'fetch_error'; } elseif ($content[0] == 200) { //返回200,才写入 if (!$direct) { $storage->write($key, $content[1]); } } else { header('HTTP/1.1 ' . $content[0]); } $content = $content[1]; } } //显示内容 $this->render($content); }
/* Module d'appartenance (valeur obligatoire) Par défaut, le nom du module est le répetoire courant */ // //$module=substr(strrchr(`pwd`, '/'), 1); //$module=trim($module); //Inclusions //include ("../lib/session.php"); //include ("../lib/functions.php"); ////include ("../lib/functions.php"); ////include ("../lib/functions.js"); //include ("./functions.php"); //include ("./functions.js"); require_once '../inc/main.php'; $action = lib::getParameterFromRequest('action'); $id_fta_classification2 = Lib::getParameterFromRequest('id_fta_classification2'); $idProprietaireGroupe = Lib::getParameterFromRequest('selection_proprietaire1'); $idProprietaireEnseigne = Lib::getParameterFromRequest(ClassificationFta2Model::FIELDNAME_ID_PROPRIETAIRE_ENSEIGNE); $idMarque = Lib::getParameterFromRequest(ClassificationFta2Model::FIELDNAME_ID_MARQUE); $idActivite = Lib::getParameterFromRequest(ClassificationFta2Model::FIELDNAME_ID_ACTIVITE); $idRayon = Lib::getParameterFromRequest(ClassificationFta2Model::FIELDNAME_ID_RAYON); $idEnvironnement = Lib::getParameterFromRequest(ClassificationFta2Model::FIELDNAME_ID_ENVIRONNEMENT); $idReseau = Lib::getParameterFromRequest(ClassificationFta2Model::FIELDNAME_ID_RESEAU); $idSaisonalite = Lib::getParameterFromRequest(ClassificationFta2Model::FIELDNAME_ID_SAISONNALITE); /* ----------------- ACTION A TRAITER ----------------- ----------------------------------- Détermination de l'action en cours