public function shenheAction() { global $_F; // $_F["debug"] = true; $tid = FRequest::getPostInt('tid'); $params = array("tid" => $tid); // $params =json_encode($params); // echo($params); $url = FConfig::get('global.service_mumu_url') . "/s/topic/IClose"; // $url = "http://yfservice.admin.docker:8081/s/topic/IClose"; // echo( $url); //$params=Service_Common::post($url,$params); //$cookie = "sid=306123456;uid=5000513;key=306123456"; $cookie = "sid=" . FSession::get('sid') . ";uid=" . FSession::get('user_id') . ";key=" . FSession::get('sid'); $params = FHttp::doPost($url, $params, $cookie); //print_r($params); $params = json_decode($params); if ($params->status == "ok") { $this->showMessage("封闭成功", $messageType = 'success'); echo "<script LANGUAGE='javascript'>guanbi('guanbi_" . $tid . "');</script>"; } else { $this->showMessage("封闭失败", $messageType = 'success'); } return; }
/** * @return PDO * @throws Exception */ public static function connect($db = "mumu", $type = "w") { $log = new FLogger("db_log"); global $_F; $gConfig = FConfig::get('db'); $curConfig = null; if ($db == self::$DB_MUMU) { // mumu库 if ($type == self::$DB_WRITE) { $curConfig = $gConfig['mumu_write']['default']; } else { $curConfig = $gConfig['mumu_read']['default']; } } elseif ($db == self::$DB_MUMU_STAT) { // 统计库 if ($type == self::$DB_WRITE) { $curConfig = $gConfig['stats_write']['default']; } else { $curConfig = $gConfig['stats_read']['default']; } } elseif ($db == self::$DB_MUMU_MESSAGE) { // 消息库 if ($type == self::$DB_WRITE) { $curConfig = $gConfig['message_read']['default']; } else { $curConfig = $gConfig['message_read']['default']; } } elseif ($db == self::$DB_MUMU_SORT) { // 消息库 if ($type == self::$DB_WRITE) { $curConfig = $gConfig['sort_write']['default']; } else { $curConfig = $gConfig['sort_read']['default']; } } elseif ($db == self::$DB_DSTAT) { // Dstat 库 if ($type == self::$DB_WRITE) { $curConfig = $gConfig['dstat_write']['default']; } else { $curConfig = $gConfig['dstat_read']['default']; } } else { throw new Exception("DB Connect Config [" . $db . "] not found!"); } $dsn = $curConfig['dsn']; if (isset(self::$_connects[$dsn])) { return self::$_connects[$dsn]; } $attr = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_PERSISTENT => false); $attr[PDO::ATTR_TIMEOUT] = 5; try { $dbh = new PDO($curConfig['dsn'], $curConfig['user'], $curConfig['password'], $attr); $dbh->exec("SET NAMES '" . $gConfig['charset'] . "'"); } catch (PDOException $e) { $log->append("---cache----" . $e->getMessage()); throw new Exception("连接数据库[" . $db . "-" . $type . "]失败:" . $e->getMessage()); } self::$_connects[$dsn] = $dbh; return $dbh; }
/** * +---------------------------------------------------------- * 日志直接写入 * +---------------------------------------------------------- * @static * @access public * +---------------------------------------------------------- * * @param string $message 日志信息 * @param int|string $type 日志记录方式 * @param string $level 日志级别 * * @return void */ static function write($message, $type = 'common', $level = self::LOG_LEVEL_INFO) { global $_F; if (is_array($message)) { $message = json_encode($message); } $now = date("Y-m-d H:i:s"); $log_file_size = FConfig::get('logger.LOG_FILE_SIZE'); $log_file_size = $log_file_size ? $log_file_size : 1024000; $file_log_path = FConfig::get('logger.LOG_PATH'); $file_log_path = $file_log_path ? $file_log_path : F_APP_ROOT . 'data/logs/'; // $file_log_path = $file_log_path; if ($_F['run_in'] == 'shell') { $file_log_path .= $_F['run_in'] . '/'; } elseif (isset($_F['module'])) { $file_log_path .= $_F['module'] . '/'; } if ($type) { $file_log_path .= "{$type}/"; } $file_log_path .= date('Y-m-d') . '.log'; FFile::mkdir(dirname($file_log_path)); if (is_file($file_log_path) && floor($log_file_size) <= filesize($file_log_path)) { rename($file_log_path, str_replace(basename($file_log_path), date('Y-m-d.H_i_s') . '.log', $file_log_path)); } $write_content = "{$now}\t{$level}"; if ($_SERVER['REQUEST_URI']) { $write_content .= "\tURL:http:/" . "/{$_F['http_host']}{$_F['uri']}\t" . ($_F['refer'] ? "REFER:{$_F['refer']}" : ''); // } else { // $write_content .= "\t{$_F['run_in']}\t{$_F['module']}"; } $write_content .= "\t{$message}\r\n"; file_put_contents($file_log_path, $write_content, FILE_APPEND); }
/** * 某商品结果(二维码,密码) * @throws Exception */ public function detailAction() { global $_F; /*echo "cookie: ".json_encode($_COOKIE)."<br>";*/ if (!$this->isLogin()) { return; } $id = FRequest::getInt("id"); $table = new FTable("mall_buy_history", "mb"); $buy = $table->where(array("id" => $id))->find(); if ($buy["uid"] != $_F["uid"]) { /* echo "信息不符".json_encode($buy)."---".$_F["uid"]."---".json_encode($_COOKIE);*/ return; } if (!$buy["item_id"] || $buy["item_id"] <= 0) { return; } $this->assign("buy", $buy); $table = new FTable("mall_inventory", "mi"); $r = $table->fields(array("mall.title", "mall.pic", "mi.goods_id", "mi.secrete", "mi.status"))->leftJoin("mall", "mall", "mi.goods_id = mall.id")->where(array("mi.id" => $buy["item_id"]))->find(); $secrete = json_decode($r["secrete"], true); $this->assign("secrete", $secrete); $this->assign("buy_info", $r); $this->assign("base_url", FConfig::get('global.base_url') . "/mall/info"); $this->display('mall_detail'); }
public function saveAttach($field, $attach_type = 'images', $obj = null) { global $_F; if ($_FILES[$field]['size'] < 1) { return -1; } if (!$obj) { $obj = $attach_type . '/' . date('Y-m') . '/' . date('d') . '/' . date('YmdHis') . '.attach'; } // 处理扩展名 if (strpos($obj, '.attach')) { $_file_path_info = pathinfo($_FILES[$field]['name']); $file_ext = strtolower($_file_path_info['extension']); if ($file_ext == 'jpeg') { $file_ext = 'jpg'; } elseif ($file_ext == 'php') { $file_ext = 'txt'; } $default_upload_ext = array('jpg', 'png', 'gif'); $config_upload_ext = explode(',', str_replace(' ', '', FConfig::get('global.upload_file_ext'))); if ($config_upload_ext) { $config_upload_ext = array_merge($config_upload_ext, $default_upload_ext); } else { $config_upload_ext = $default_upload_ext; } if (!in_array($file_ext, $config_upload_ext)) { if (FConfig::get('global.debug')) { throw new Exception('禁止上传此类型的文件。'); } return false; } $obj = str_replace('.attach', '.' . $file_ext, $obj); } // echo $obj; $attach_url = $obj; if (strpos($obj, PUBLIC_ROOT) === false) { $obj = PUBLIC_ROOT . "uploads/" . $obj; } $attach_dir = dirname($obj); if (!is_dir($attach_dir)) { mkdir($attach_dir, 0777, true); } if ($_FILES[$field]) { // $a = (is_uploaded_file($_FILES [$field] ['tmp_name'])); if (!move_uploaded_file($_FILES[$field]['tmp_name'], $obj)) { throw new Exception('请检查public/uploads目录是否可写!'); } // $attachDAO = new DAO_Attach (); $data = array('file_name' => $_FILES[$field]['name'], 'file_type' => $_FILES[$field]['type'], 'file_size' => $_FILES[$field]['size'], 'file_path' => $attach_url); //$attachDAO->add ( $data ); return $data; } return false; }
/** * +---------------------------------------------------------- * 应用程序初始化 * +---------------------------------------------------------- * @access public * +---------------------------------------------------------- * @return void +---------------------------------------------------------- */ public static function init() { global $_F; if (FConfig::get('global.debug')) { $_F['debug'] = true; } if (FConfig::get('global.session.type') == 'db') { $handler = new FSession(); session_set_save_handler(array(&$handler, "open"), array(&$handler, "close"), array(&$handler, "read"), array(&$handler, "write"), array(&$handler, "destroy"), array(&$handler, "gc")); $handler->start(); } }
/** * 打开Session * @access public * @param string $savePath * @param mixed $session_name * @return bool */ public function open($savePath, $session_name) { global $_F; if (FConfig::get('global.session.type') != 'db') { $this->sessionSavePath = $savePath; $this->sessionName = $session_name; } $life_time = FConfig::get('global.session.life_time'); $sessionTable = FConfig::get('global.session.table'); $this->lifeTime = $life_time ? $life_time : ini_get('session.gc_maxlifetime'); $this->sessionTable = $sessionTable ? $sessionTable : "sys_session"; return true; }
public function __construct($count) { /*{{{*/ $this->count = intval($count); $this->current = 1; $this->size = FConfig::item('config.pageSize'); $this->_minSize = FConfig::item('config.pageSize'); $this->previous = false; $this->next = false; $this->first = false; $this->last = false; $this->baseurl = ''; $this->_selectType = array($this->size, 30, 50); }
public function __construct($db_name) { $config = FConfig::get('redis_config'); $this->_HOST = $config['REDIS_HOST']; $this->_PORT = $config['REDIS_PORT']; $this->_TIMEOUT = $config['REDIS_TIMEOUT']; $this->_DBNAME = $db_name; $this->_CTYPE = $config['REDIS_CTYPE']; if (!isset($this->_REDIS)) { $this->_REDIS = new Redis(); $this->connect($this->_HOST, $this->_PORT, $this->_TIMEOUT, $this->_CTYPE); // $this->_REDIS->select($this->_DBNAME); } }
/** * @return FMongoDB */ public static function getInstance($db_conf = 'default') { static $mongo = array(); if (!FConfig::get('global.mongoDB.enable')) { FLogger::write('调用了 FMongoDB,但是 配置中没有启用 global.mongoDB.enable', 'error'); return new FMongoDBNull(); } if (isset($mongo[$db_conf])) { return $mongo[$db_conf]; } else { $mongo[$db_conf] = new FMongoDB(FConfig::get('db.mongoDB.' . $db_conf . '.dsn')); $mongo[$db_conf]->selectDb(FConfig::get('db.mongoDB.' . $db_conf . '.db')); return $mongo[$db_conf]; } }
/** * +---------------------------------------------------------- * 应用程序初始化 * +---------------------------------------------------------- * @access public * +---------------------------------------------------------- * @return void +---------------------------------------------------------- */ public static function init() { $session_type = FConfig::get('global.session.type'); if ($session_type == 'db') { $handler = new FSession(); session_set_save_handler(array(&$handler, "open"), array(&$handler, "close"), array(&$handler, "read"), array(&$handler, "write"), array(&$handler, "destroy"), array(&$handler, "gc")); $handler->start(); } elseif ($session_type == 'memcache') { ini_set('session.save_handler', 'memcache'); ini_set('session.save_path', 'tcp:/' . '/127.0.0.1:11211'); // . FConfig::get('global.memcache.ip') $handler = new FSession(); $handler->start(); } else { $handler = new FSession(); $handler->start(); } }
public function shenhe_cheAction() { // global $_F; // $_F["debug"] = true; $uid = FRequest::getInt('uid'); $params = array("uid" => $uid); $params = json_encode($params); $url = FConfig::get('global.service_mumu_url') . "/user/UnBanUser"; $params = Service_Common::post($url, $params); $params = json_decode($params); if ($params->status == "ok") { // $this->showMessage("撤销成功",$messageType = 'success'); // echo( "<script LANGUAGE='javascript'>zhuangtai_che('stat".$uid."');</script>"); echo "ok"; } else { // $this->showMessage("撤销失败",$messageType = 'success'); } return; }
public function shenheAction() { //global $_F; // $_F["debug"] = true; $id = FRequest::getInt('id'); $picslevel = FRequest::getPostInt('picslevel'); $topic_table = new FTable("topic"); $topic_table->where(array('id' => $id))->update(array("picslevel" => $picslevel)); $params = array("tid" => "200"); $params = json_encode($params); $url = FConfig::get('global.service_mumu_url') . "/topic/ClearCache"; $params = Service_Common::post($url, $params); $params = json_decode($params); if ($params->status == "ok") { $this->showMessage("审核成功", $messageType = 'success'); } else { $this->showMessage("审核失败", $messageType = 'success'); } return; }
/** * 约会说明 */ public function dateAction() { global $_F; //$_F["debug"] = true; $uid = FCookie::get("uid"); $user = Service_Client::getUserByUid($uid); if ($user["province"] == "北京" || $user["province"] == "天津" || $user["province"] == "上海" || $user["province"] == "重庆") { $user["city"] = $user["province"]; } $table = new FTable("date_place"); $place_num = $table->where(array("city" => $user["city"]))->count(); $table = new FTable("date_request", "dr"); $query_sql = " ( ud.province = '" . $user["city"] . "' or ud.city = '" . $user["province"] . "' )"; $date_num = $table->leftJoin("user_detail", "ud", "dr.uid1=ud.uid")->where(array("dr.available" => 1, "str" => $query_sql))->count(); $this->assign("base_url", FConfig::get('global.base_url')); $this->assign("place_num", $place_num); $this->assign("user", $user); $this->assign("date_num", $date_num); $this->display('client_date'); }
/** * 连接 */ public static function connect() { global $_F; try { $ip = FConfig::get('global.cache.ip'); $port = FConfig::get('global.cache.port'); $isOpen = FConfig::get('global.cache.isOpen'); if ($isOpen) { $cache = new Memcache(); $result = $cache->connect($ip, $port); if ($result) { $_F['cache'] = $cache; } return true; } else { return false; } } catch (Exception $e) { return false; } }
public function shenheAction() { global $_F; // $_F["debug"] = true; $size = FRequest::getPostInt('size'); $list = FRequest::getPostString('avatarlevel' . $size); $query = explode(",", $list); $params_uid = array("id" => $query[0], "status" => $query[1]); $url_rztz = FConfig::get('global.service_mumu_url') . "/s/user/ICertifyVideo"; $cookie = "sid=" . FSession::get('sid') . ";uid=" . FSession::get('user_id') . ";key=" . FSession::get('sid'); $params_rztz = FHttp::doPost($url_rztz, $params_uid, $cookie); $params = json_decode($params_rztz); if ($params->status == "ok") { // $this->showMessage("审核成功",$messageType = 'success'); } else { // $this->showMessage("审核失败",$messageType = 'success'); } //echo(json_encode($params_uid)); // $this->showMessage("审核失败",$messageType = 'success'); //exit; return; }
public function load($tpl) { global $_F; $this->set('_F', $_F); $view_compress = FConfig::get('view.compress'); $contents = $this->fetch($tpl); if ($view_compress) { // 会有 http:// 这样的都替换没了 //$contents = preg_replace('#//.*$#im', '', $contents); $contents = preg_replace('#<!--.+?-->#si', '', $contents); $contents = preg_replace('/^\\s+/im', '', $contents); $contents = preg_replace('/>\\s+/im', '>', $contents); } if ($_F['debug'] && !$_F['in_ajax']) { $contents .= $this->getDebugInfo(); } return $contents; }
*/ ?> <div class="headerContainer"> <div class="header"> <div class="logo"> <a href="<?php if ($session == true) { echo "miHome"; } else { echo "home"; } ?> "> <img alt="Fototea" src="<?php echo FConfig::getUrl('images/logo_fototea.png'); ?> " border="0" title="Fototea" height="39"> </a> </div> <div class="containerMenuInicio"> <div class="menuInicio"><a href="contratar">Contratar</a></div> <span>|</span> <div class="menuInicio"><a href="trabajar">Trabajar</a></div> <span>|</span> <div class="menuInicio"><a href="faq">FAQ</a></div> </div> <div class="containerLogin"> <?php if ($session == false) { ?>
private function _checkRouter(&$c, &$a) { global $_F; if (isset($_F['module'])) { $router = FConfig::get("router.{$_F['module']}"); } else { $router = FConfig::get("router"); } if (!$router) { return false; throw new Exception("{$router_config_file} not found !"); } $uri = strtolower($_F['uri']); if (isset($router[$uri])) { if ($router[$uri]['url']) { redirect($router[$uri]['url']); } if ($router[$uri]['module']) { $_F['module'] = $router[$uri]['module']; } $c = $router[$uri]['controller']; $a = $router[$uri]['action']; return true; } else { foreach ($router as $key => $configRow) { if (strpos($key, '(') === false) { continue; } if (preg_match("#^{$key}\$#i", $_F['uri'], $res)) { if ($configRow['url']) { redirect($configRow['url']); } if ($configRow['module']) { $_F['module'] = $configRow['module']; } $c = $router[$key]['controller']; $a = $router[$key]['action']; $params = explode(',', $router[$key]['params']); foreach ($params as $k => $p) { $p = trim($p); $_GET[$p] = $res[$k + 1]; } break; } } return false; } }
$greetings = "上午好,"; } elseif (12 <= date('G') && date('G') < 18) { $greetings = "下午好,"; } elseif (18 <= date('G') && date('G') < 24) { $greetings = "晚上好,"; } $userHeadInfo['greetings'] = $greetings . Fn::wsubstr($this->user['nick_name'], 0, 10); $userHeadInfo['email_check'] = $this->userInfo['email_check']; $userHeadInfo['person_id'] = $this->userInfo['person_id']; if ($this->user['phone_num']) { $userHeadInfo['phone_check'] = 1; } else { $userHeadInfo['phone_check'] = 0; } $userHeadInfo['level'] = $userHeadInfo['email_check'] + $userHeadInfo['person_id'] + $userHeadInfo['phone_check']; $levels = FConfig::item("config.user_level"); $userHeadInfo['level_name'] = $levels[$userHeadInfo['level']]; ?> <div class="g-sd2 sidebar"> <!-- 个人信息 --> <div class="profile"> <div class="pf-hd"> <img src="<?php echo FF_DOMAIN; ?> /upload/images/user_head.png" width="95" height="95" /> </div> <div class="pf-name"><?php echo $userHeadInfo['greetings']; ?> </div>
function listAction() { //global $_F; //$_F["debug"] = true; $uid = CommonUtil::getDefStr(FRequest::getPostString('uid'), ""); $tj25 = json_decode(FRequest::getPostString('tj25')); $tj26 = json_decode(FRequest::getPostString('tj26')); $tj27 = json_decode(FRequest::getPostString('tj27')); $tj28 = json_decode(FRequest::getPostString('tj28')); $tj30 = json_decode(FRequest::getPostString('tj30')); $tj31 = json_decode(FRequest::getPostString('tj31')); $tj32 = json_decode(FRequest::getPostString('tj32')); $stats_date = FRequest::getString('stats_date'); if (!$stats_date) { $this->showMessage("请输入统计日期", error); return; } $url = FConfig::get('global.service_mumu_url') . "/user/AdminTjInfo"; /* $params = array("uid"=>$uid,"date"=>$stats_date); $params=Service_Common::post($url,json_encode($params)); $params=json_decode($params); if($params->status=="ok"){ $this->assign("tj",$params->res); } else{ $this->showMessage("查找失败",$messageType = 'success'); return; }*/ if (!$uid || $uid == 25) { $params25 = array("uid" => 25, "date" => $stats_date); $params25 = Service_Common::post($url, json_encode($params25)); $params25 = json_decode($params25); if ($params25->status == "ok") { $tj25 = $params25->res; } } if (!$uid || $uid == 26) { $params26 = array("uid" => 26, "date" => $stats_date); $params26 = Service_Common::post($url, json_encode($params26)); $params26 = json_decode($params26); if ($params26->status == "ok") { $tj26 = $params26->res; } } if (!$uid || $uid == 27) { $params27 = array("uid" => 27, "date" => $stats_date); $params27 = Service_Common::post($url, json_encode($params27)); $params27 = json_decode($params27); if ($params27->status == "ok") { $tj27 = $params27->res; } } if (!$uid || $uid == 28) { $params28 = array("uid" => 28, "date" => $stats_date); $params28 = Service_Common::post($url, json_encode($params28)); $params28 = json_decode($params28); if ($params28->status == "ok") { $tj28 = $params28->res; } } if (!$uid || $uid == 30) { $params30 = array("uid" => 30, "date" => $stats_date); $params30 = Service_Common::post($url, json_encode($params30)); $params30 = json_decode($params30); if ($params30->status == "ok") { $tj30 = $params30->res; } } if (!$uid || $uid == 31) { $params31 = array("uid" => 31, "date" => $stats_date); $params31 = Service_Common::post($url, json_encode($params31)); $params31 = json_decode($params31); if ($params31->status == "ok") { $tj31 = $params31->res; } } if (!$uid || $uid == 32) { $params32 = array("uid" => 32, "date" => $stats_date); $params32 = Service_Common::post($url, json_encode($params32)); $params32 = json_decode($params32); if ($params32->status == "ok") { $tj32 = $params32->res; } } $this->assign("tj25", $tj25); $this->assign("tj26", $tj26); $this->assign("tj27", $tj27); $this->assign("tj28", $tj28); $this->assign("tj30", $tj30); $this->assign("tj31", $tj31); $this->assign("tj32", $tj32); $this->assign("tj25_jd", json_encode($tj25)); $this->assign("tj26_jd", json_encode($tj26)); $this->assign("tj27_jd", json_encode($tj27)); $this->assign("tj28_jd", json_encode($tj28)); $this->assign("tj30_jd", json_encode($tj30)); $this->assign("tj31_jd", json_encode($tj31)); $this->assign("tj32_jd", json_encode($tj32)); $this->assign("uid", $uid); $this->assign("stats_date", $stats_date); $this->display('admin/uidtj_list'); }
public function load($tpl) { global $_F; $tpl = $this->getDefaultTpl($tpl); $this->set('_F', $_F); $view_compress = FConfig::get('global.output_compress'); $contents = $this->fetch($tpl); if ($view_compress) { // 会有 http:// 这样的都替换没了 $contents = preg_replace('#^\\s*/' . '/.*$#im', '', $contents); $contents = preg_replace('#<!--.+?-->#si', '', $contents); $contents = preg_replace('/^\\s+/im', '', $contents); $contents = preg_replace('/>\\s+/im', '>', $contents); $contents = preg_replace('/\\s*([{};,])\\s*/im', '\\1', $contents); // $contents = preg_replace('/\s+/im', ' ', $contents); } if ($_F['debug'] && !$_F['in_ajax']) { $contents .= FView::getDebugInfo(); } return $contents; }
<input type="hidden" name="cbt" value="Regresa a Fototea" /> <input type="hidden" name="currency_code" value="EUR" /> <!-- Allow customer to enter desired quantity --> <input type="hidden" name="quantity" value="1" /> <input type="hidden" name="item_name" value="Proyecto" /> <input type="hidden" name="shipping" value="0" /> <input type="hidden" name="invoice" value="<?php echo date("YdmHis"); ?> " /> <input type="hidden" name="amount" value="50" /> <input type="hidden" name="return" value="<?php echo FConfig::getUrl('shop/paypal/thankyou'); ?> "/> <input type="hidden" name="cancel_return" value="<?php echo FConfig::getUrl('shop/paypal/cancelled'); ?> " /> <!-- Where to send the paypal IPN to. --> <input type="hidden" name="notify_url" value="<?php echo FConfig::getUrl('actions/processAction.php'); ?> " /> <input type="submit" name="METHOD" value="Pay"> </form>
public function shenheAction() { // global $_F; // $_F["debug"] = true; $size = FRequest::getPostInt('size'); $list = array(); /* for($j=1;$j <$size;$j++) { $list[$j-1] =FRequest::getPostString('avatarlevel'.$j); } $list[$size-1] = FRequest::getPostString('avatarlevel'.$size); */ $list[0] = FRequest::getPostString('avatarlevel' . $size); $params = array("list" => $list); $params = json_encode($params); //$this->showMessage($params,$messageType = 'success'); // exit; $url = FConfig::get('global.service_mumu_url') . "/user/AdminSetAvatarStat"; $params = Service_Common::post($url, $params); $params = json_decode($params); if ($params->status == "ok") { //$this->showMessage("审核成功",$messageType = 'success'); } else { $this->showMessage("审核失败", $messageType = 'success'); } return; }
public static function init() { global $_F; $_F['config'] = array(); header("Content-type: text/html; charset=utf-8"); header("Access-Control-Allow-Origin: *"); if (!defined('FLIB_ROOT')) { define('FLIB_ROOT', dirname(__FILE__) . '/'); } date_default_timezone_set('Asia/Chongqing'); ini_set("error_reporting", E_ALL & ~E_NOTICE); if (phpversion() < '5.3.0') { set_magic_quotes_runtime(0); } $_F['user_agent'] = $_SERVER['HTTP_USER_AGENT']; $_F['query_string'] = $_SERVER['QUERY_STRING']; $_F['http_host'] ? $_F['http_host'] : ($_F['http_host'] = $_SERVER['HTTP_HOST']); $last_part = substr($_F['http_host'], strrpos($_F['http_host'], '.')); $left_part = str_replace($last_part, '', $_F['http_host']); $_F['cookie_domain'] = substr($left_part, strrpos($left_part, '.')) . $last_part; $_F['domain'] = trim($_F['cookie_domain'], '.'); $_F['subdomain'] = str_replace($_F['cookie_domain'], '', $_F['http_host']); $_F['refer'] = $_REQUEST['refer'] ? $_REQUEST['refer'] : $_SERVER['HTTP_REFERER']; $_F['in_ajax'] = $_REQUEST['in_ajax'] || $_GET['in_ajax'] || $_POST['in_ajax'] ? true : false; if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { $_F['in_ajax'] = true; } $_F['is_post'] = $_POST ? true : false; $_F['run_in'] = isset($_SERVER['HTTP_HOST']) ? 'web' : 'shell'; define('IS_POST', $_F['is_post']); // 注册AUTOLOAD方法,设定错误和异常处理 spl_autoload_register(array('Flib', 'autoLoad')); register_shutdown_function(array('Flib', 'fatalError')); set_error_handler(array('Flib', 'appError')); set_exception_handler(array('Flib', 'appException')); if (FConfig::get('global.flib_compress')) { if (!file_exists(APP_ROOT . "data/_flib_min.php")) { self::createFlibMin(); } include_once APP_ROOT . "data/_flib_min.php"; } $sub_domain_status = FConfig::get('global.sub_domain.status'); // 是否开了子域名 if ($sub_domain_status == 'on') { foreach (FConfig::get('global.sub_domain.sub_domain_rewrite') as $key => $value) { if ($key == $_F['subdomain']) { $_F['module'] = $value; } if ($key == '*') { $default_module = $value; } } if (!$_F['module']) { $_F['module'] = $default_module; } } if (!$_F['uri']) { FDispatcher::init(); } }
public static function getConfig() { return FConfig::get('db'); }
public function actionUpdatePwd() { $response = array(); $user_phone = $this->request->getParam('user_phone'); $new_pwd = trim($this->request->getParam('new_pwd')); $phone_code = trim($this->request->getParam('phone_code')); $verifyCode = FCookie::get(FConfig::item('config.cookie.phone_key')); $verifyCode = Fn::crypt($verifyCode, FConfig::item('config.cookie.phone_code'), 'decode'); if ($phone_code != $verifyCode) { $response['status'] = 100001; $response['content'] = '短信验证失败!'; } else { $res = $this->user_model->updateAll(array('password' => md5($new_pwd)), 'phone_num=:phone', array(':phone' => $user_phone)); if ($res) { $response['status'] = 100000; $response['content'] = '修改密码成功!'; } else { $response['status'] = 100002; $response['content'] = '修改密码失败!'; } } Yii::app()->end(FHelper::json($response['content'], $response['status'])); }
public function shenheAction() { global $_F; // $_F["debug"] = true; $size = FRequest::getPostInt('size'); $list = array(); /* for($j=1;$j <$size;$j++) { $list[$j-1] =FRequest::getPostString('avatarlevel'.$j); } $list[$size-1] = FRequest::getPostString('avatarlevel'.$size); */ $list[0] = FRequest::getPostString('avatarlevel' . $size); $params = array("list" => $list); $query = explode(",", $list[0]); $query = $query[0]; $params_uid = array("uid" => $query); $params = json_encode($params); //$this->showMessage($params,$messageType = 'success'); // exit; $url = FConfig::get('global.service_mumu_url') . "/user/AdminSetAvatarStat"; $params = Service_Common::post($url, $params); /*$url_rztz = FConfig::get('global.service_mumu_url')."/s/user/ICertifyAvatar"; $params_rztz=Service_Common::post($url_rztz,json_encode($params_uid));*/ $url_rztz = FConfig::get('global.service_mumu_url') . "/s/user/ICertifyAvatar"; $cookie = "sid=" . FSession::get('sid') . ";uid=" . FSession::get('user_id') . ";key=" . FSession::get('sid'); $params_rztz = FHttp::doPost($url_rztz, $params_uid, $cookie); $params = json_decode($params); /* $url_rztz = FConfig::get('global.service_mumu_url')."/s/user/ICertifyAvatar"; $params_rztz=Service_Common::post($url_rztz,$params_uid);*/ if ($params->status == "ok") { //$this->showMessage("审核成功",$messageType = 'success'); } else { $this->showMessage("审核失败", $messageType = 'success'); } return; }
/** * _load * 载入配置 * * @param string $rootkey 根key * @param mixed $conf 配置 * @param string $file 定义配置文件 * throw new FConfig_Exception * * @return void */ protected function _load($rootkey, $conf = false, $file = null) { if ($conf === false) { if (in_array($file, self::$_loaded)) { return; } else { array_push(self::$_loaded, $file); } if (!is_file($file)) { $file = FLIB_ROOT . '/config/global.php'; } require_once $file; } if (is_array($conf)) { foreach ($conf as $key => $value) { FConfig::set($rootkey . '.' . $key, $value); } } }
<input type="hidden" name="shipping" value="0" /> <input type="hidden" name="invoice" value="<?php echo date("YdmHis"); ?> " /> <input type="hidden" name="amount" value="<?php echo $total; ?> " /> <input type="hidden" name="return" value="<?php echo FConfig::getUrl('proyectoFinalizar?id=') . $pro_id; ?> "/> <input type="hidden" name="cancel_return" value="<?php echo FConfig::getUrl('confirmProyecto?id=') . $pro_id; ?> " /> <!-- Where to send the paypal IPN to. --> <input type="hidden" name="notify_url" value="<?php echo FConfig::getUrl('actions/processAction.php?p=') . $pro_id . '&of=' . $rs_oferta->id; ?> " /> <div class="btn_naranja"><a href="javascript:sendForm()">Pagar y Finalizar</a></div> </form> </div> </div> </div>