function vaild() { if (!front::post('name')) { front::flash('请填写名称!'); return false; } return true; }
private function check_mytable() { if(!preg_match('/^my_.+/',front::post('name'))) { front::flash('表名格式必须是是"my_abc"!'); return false; } return true; }
function respond() { ini_set("display_errors","On"); $where = array('ologin_code'=>front::$get['ologin_code']); $ologins = ologin::getInstance()->getrows($where); $ologin = unserialize_config($ologins[0]['ologin_config']); //var_dump($ologin); $aliapy_config['partner'] = $ologin['alipaylogin_id']; $aliapy_config['key'] = $ologin['alipaylogin_key']; $aliapy_config['return_url'] = ologin::url(basename(__FILE__,'.php')); $aliapy_config['sign_type'] = 'MD5'; $aliapy_config['input_charset']= 'utf-8'; $aliapy_config['transport'] = 'http'; $aliapy_config['cacert'] = getcwd().'/lib/plugins/alipayauth/cacert.pem'; //var_dump($aliapy_config); unset($_GET['case']);unset($_GET['act']);unset($_GET['ologin_code']);unset($_GET['site']); require_once("alipayauth/alipay_notify.class.php"); $alipayNotify = new AlipayNotify($aliapy_config); //var_dump($alipayNotify); $verify_result = $alipayNotify->verifyReturn(); //var_dump($verify_result); if($verify_result) {//验证成功 $user_id = front::$get['user_id']; $token = front::$get['token']; session::set('access_token',$token); session::set("openid",$user_id); return array('nickname'=> front::get('real_name')); } else { echo "验证失败";exit; } }
function manage_action() { if(!config::get('sms_username') || !config::get('sms_password')){ echo '<script>alert("您需要先设置用户名和密码才能使用短信管理功能!");window.location.href="'.url('config/system/set/sms').'";</script>'; exit; } include_once("phprpc/phprpc_client.php"); $client = new PHPRPC_Client(); $client->setProxy(NULL); $client->useService('http://pay.cmseasy.cn/sms.php'); $client->setKeyLength(128); $client->setEncryptMode(3); $info = $client->getInfo(config::get('sms_username'),md5(config::get('sms_password'))); $info[0] = intval($info[0]); $info[1] = intval($info[1]); $this->view->info = $info; if (front::post('submit')) { if (front::post('act') == 'test') { $rs = sendMsg(front::post('mobile'),'test'); if($rs->SendSMSResult == '0'){ front::flash('发送成功'); }else{ front::flash('发送失败,请检查用户名、密码或剩余条数'); } } }else{ if($info[0] < 50) front::flash('你的剩余短信不足50条,请及时充值'); } }
public function savewysiwygAction() { $db = front::og('db'); $alias = front::$_req['alias']; // проверяем права (могут быть разные для разных страниц) switch ($alias) { default: $permission = null; } if (!$permission || !hasPermissions($permission)) { return; } $text = front::$_req['form']['n_text']; $text = iconv('UTF-8', 'CP1251', $text); $text = __paramValue('ckedit', $text); $title = front::$_req['form']['title']; $title = iconv('UTF-8', 'CP1251', $title); $title = __paramValue('string', $title); $save = array('title' => $title, 'n_text' => $text); if ($alias) { $aff = $db->update('UPDATE static_pages SET ?s WHERE (alias = ?)', $save, $alias); if (!$aff) { $save['alias'] = $alias; $db->insert('static_pages', $save, false); } } echo json_encode(array('success' => true, 'alias' => $alias)); }
function getjs_action() { $lang=include ROOT.'/lang/'.config::get('lang_type').'/system.php'; $id=front::get('id'); if(preg_match('/select/i',$id)){ exit('非法参数'); } $ballot=new ballot(); $option=new option(); $where=array('id'=>$id); $arr=$ballot->getrow($where); $row=$option->getrows(array('bid'=>$id),null,'num desc'); $this->view->arr=$arr; $this->view->row=$row; $this->view->lang=$lang; /*$html='document.write(\'<form name="form1" method="post" action="'.url("ballot").'">\');'; $html .= 'document.write(\'<input type="hidden" name="bid" id="bid" value="'.$arr['id'].'" />\');'; $html .= 'document.write(\'<h5>\');'; $html .= 'document.write(\''.$arr['title']."</h5>');"; foreach ($row as $option) { if ($arr['type'] == 'radio') { $html .= 'document.write(\'<input type="radio" name="ballot" id="ballot" value="'.$option['id'].'" />\');'; } else { $html .= 'document.write(\'<input type="checkbox" name="ballot[]" id="ballot" value="'.$option['id'].'" />\');'; } $html .= 'document.write(\' '.$option['name'].' ('.$option['num'].')<br>\');'; } $html .= 'document.write(\'<input type="submit" name="submit" id="button" value=" '.$lang['vote'].'" /></form>\');'; echo $html;*/ }
function getlistAction() { $data[] = array("title" => "Контроллеры", "_is_leaf" => false, "testable" => false, "_parent" => null, "_id" => "1"); $data = $this->readMap(front::$map, $data); $data[] = array("title" => "Модели", "_is_leaf" => false, "_parent" => null, "_id" => "2"); $dir = opendir(ROOT_DIR . "engine/models/"); while ($file = readdir($dir)) { if ($file != "." && $file != ".." && $file != ".svn") { $testable = true; $class_name = array_shift(explode(".", $file)); $test_path = "tests/models/" . $class_name . ".model.test.php"; if (!file_exists(ROOT_DIR . "engine/" . $test_path)) { $test_path = "<b>Нет " . $test_path . "</b>"; $testable = false; } $data[] = array("title" => $file, "path" => $test_path . "<i> для " . $file . "</i>", "testable" => $testable, "result" => $testable ? 0 : 4, "run_path" => "tests/models/" . $class_name . ".model.test.php", "_is_leaf" => true, "_parent" => "2", "_id" => "3:" . $class_name); } } closedir($dir); $data[] = array("title" => "Другие", "_is_leaf" => false, "_parent" => null, "_id" => "3"); $dir = opendir(ROOT_DIR . "engine/tests/"); while ($file = readdir($dir)) { if ($file != "." && $file != ".." && is_file(ROOT_DIR . "engine/tests/" . $file)) { $testable = true; $data[] = array("title" => $file, "path" => $file, "testable" => $testable, "result" => $testable ? 0 : 4, "run_path" => "tests/" . $file, "_is_leaf" => true, "_parent" => "3", "_id" => "4:" . $file); } } closedir($dir); $data = front::toUtf($data); echo json_encode(array("data" => $data)); }
public function getlistAction() { $data[] = array('title' => 'Контроллеры', '_is_leaf' => false, 'testable' => false, '_parent' => null, '_id' => '1'); $data = $this->readMap(front::$map, $data); $data[] = array('title' => 'Модели', '_is_leaf' => false, '_parent' => null, '_id' => '2'); $dir = opendir(ROOT_DIR . 'engine/models/'); while ($file = readdir($dir)) { if ($file != '.' && $file != '..' && $file != '.svn') { $testable = true; $class_name = array_shift(explode('.', $file)); $test_path = 'tests/models/' . $class_name . '.model.test.php'; if (!file_exists(ROOT_DIR . 'engine/' . $test_path)) { $test_path = '<b>Нет ' . $test_path . '</b>'; $testable = false; } $data[] = array('title' => $file, 'path' => $test_path . '<i> для ' . $file . '</i>', 'testable' => $testable, 'result' => $testable ? 0 : 4, 'run_path' => 'tests/models/' . $class_name . '.model.test.php', '_is_leaf' => true, '_parent' => '2', '_id' => '3:' . $class_name); } } closedir($dir); $data[] = array('title' => 'Другие', '_is_leaf' => false, '_parent' => null, '_id' => '3'); $dir = opendir(ROOT_DIR . 'engine/tests/'); while ($file = readdir($dir)) { if ($file != '.' && $file != '..' && is_file(ROOT_DIR . 'engine/tests/' . $file)) { $testable = true; $data[] = array('title' => $file, 'path' => $file, 'testable' => $testable, 'result' => $testable ? 0 : 4, 'run_path' => 'tests/' . $file, '_is_leaf' => true, '_parent' => '3', '_id' => '4:' . $file); } } closedir($dir); $data = front::toUtf($data); echo json_encode(array('data' => $data)); }
function show_action() { $this->view->page=front::get('page')?front::get('page'):1; $this->pagesize=config::get('list_pagesize'); $limit=(($this->view->page-1)*$this->pagesize).','.$this->pagesize; $special=new special(); $this->view->special=$special->getrow('spid='.front::get('spid')); $this->view->archive['title'] = $this->view->special['title']; $this->view->pages=true; $archive=new archive(); $archives=$archive->getrows('spid='.front::get('spid'),$limit); foreach($archives as $order=>$arc) { $archives[$order]['url']=archive::url($arc); $archives[$order]['catname']=category::name($arc['catid']); $archives[$order]['caturl']=category::url($arc['catid']); $archives[$order]['adddate']= sdate($arc['adddate']); $archives[$order]['stitle']= strip_tags($arc['title']); } $this->view->archives=$archives; $this->view->record_count=$archive->rec_count('spid='.front::get('spid')); front::$record_count=$this->view->record_count; $this->view->spid=front::get('spid'); if (front::get('t') == 'wap') { $this->out('wap/special_show.html'); return; } }
function savewysiwygAction() { $db = front::og("db"); $alias = front::$_req["alias"]; // проверяем права (могут быть разные для разных страниц) switch ($alias) { default: $permission = null; } if (!$permission || !hasPermissions($permission)) { return; } $text = front::$_req["form"]["n_text"]; $text = iconv('UTF-8', 'CP1251', $text); $text = __paramValue('ckedit', $text); $title = front::$_req["form"]["title"]; $title = iconv('UTF-8', 'CP1251', $title); $title = __paramValue('string', $title); $save = array("title" => $title, "n_text" => $text); if ($alias) { $aff = $db->update("UPDATE static_pages SET ?s WHERE (alias = ?)", $save, $alias); if (!$aff) { $save["alias"] = $alias; $db->insert("static_pages", $save, false); } } echo json_encode(array("success" => true, "alias" => $alias)); }
public function __construct() { parent::__construct(); $this->load->model('model_base'); $this->load->model('model_comment'); $this->load->helper('download_helper'); }
function add_before(act $act) { front::$post['userid']=$act->view->user['userid']; front::$post['username']=$act->view->user['username']; front::$post['checked']=1; front::$post['adddate']=date('Y-m-d H:i:s'); front::$post['ip']=front::ip(); }
function manage_action() { chkpw('func_data_adminlogs'); $where = null; $ordre = '`id` DESC'; $limit = ((front::get('page') -1) * $this->_pagesize).','.$this->_pagesize; $this->view->data = $this->_table->getrows($where,$limit,$ordre,$this->_table->getcols('manage')); $this->view->record_count = $this->_table->record_count; }
static function get($alias) { $res = front::og("db")->select("SELECT * FROM static_pages WHERE alias = ? LIMIT 1;", $alias)->fetchRow(); if (!$res) { $res = array("alias" => $alias); } return $res; }
function comment_js_action() { front::check_type(front::get('aid')); $comment=new comment(); $this->view->comments=$comment->getrows('state=1 and aid='.front::get('aid'),20,'1'); $this->view->aid=front::get('aid'); echo tool::text_javascript($this->fetch()); exit; }
public static function get($alias) { $res = front::og('db')->select('SELECT * FROM static_pages WHERE alias = ? LIMIT 1;', $alias)->fetchRow(); if (!$res) { $res = array('alias' => $alias); } return $res; }
function click_action() { $friendlink=new friendlink(); $friendlink->rec_update(array('hits'=>'[hits+1]'),front::get('id')); $where=" id=".front::get('id')." "; $friendlinks=$friendlink->getrows($where,$limit,'listorder asc,id asc'); $url=$friendlinks[0][url]; header("location: $url"); }
function deletewebsite_action() { chkpw('website_del'); $path = ROOT.'/config/website/'.front::$get['id'].'.php'; @unlink($path); $path = ROOT.'/config/help_'.front::$get['id'].'.php'; @unlink($path); echo '<script type="text/javascript">alert("操作完成!")</script>'; front::refresh(url('website/listwebsite',true)); }
function end() { if (front::get('t') == 'wap') { $this->render('wap/index.html'); return; } if (front::$debug) $this->render('style/index.html'); else $this->render(); }
public function saveAction() { $db = front::og('db'); $save = front::toWin(array('name' => front::$_req['form']['name'], 'login' => front::$_req['form']['login'], 'occupation' => front::$_req['form']['occupation'], 'email' => front::$_req['form']['email'], 'icq' => front::$_req['form']['icq'], 'skype' => front::$_req['form']['skype'], 'login' => front::$_req['form']['login'], 'groupid' => front::$_req['form']['groupid'], 'additional' => front::$_req['form']['additional'])); if (intval($id = front::$_req['id']) > 0) { $aff = $db->update('UPDATE team_people SET ?s WHERE (id = ?n)', $save, $id); } else { $id = $db->insert('team_people', $save); } echo json_encode(array('success' => true, 'id' => $id)); }
function saveAction() { $db = front::og("db"); $save = front::toWin(array("header" => front::$_req["form"]["header"], "n_text" => front::$_req["form"]["n_text"], "post_date" => front::$_req["form"]["post_date"])); if (intval($id = front::$_req["id"]) > 0) { $aff = $db->update("UPDATE news SET ?s WHERE (id = ?n)", $save, $id); } else { $id = $db->insert("news", $save); } echo json_encode(array("success" => true, "id" => $id)); }
function visual_action() { if ($this->view->usergroupid != '888') exit('PAGE NOT FOUND!'); $id=front::get('id'); $tpl=str_replace('_d_','/',$id); $tpl=str_replace('#','',$tpl); $tpl=str_replace('_html','.html',$tpl); $content=file_get_contents(TEMPLATE.'/'.config::get('template_dir').'/'.$tpl); echo @front::$view->_eval(front::$view->compile($content)); $this->render('../admin/system/tag_visual.php'); }
function editRadzelAction() { $db = front::og("db"); $save = front::toWin(array("name" => front::$_req["title"])); if (intval($id = front::$_req["id"]) > 0) { $aff = $db->update("UPDATE faq_category SET ?s WHERE (id = ?n)", $save, $id); } else { $id = $db->insert("faq_category", $save); } echo json_encode(array("success" => true, "id" => $id)); }
function saveAction() { $db = front::og("db"); $save = front::toWin(array("name" => front::$_req["form"]["name"], "login" => front::$_req["form"]["login"], "occupation" => front::$_req["form"]["occupation"], "email" => front::$_req["form"]["email"], "icq" => front::$_req["form"]["icq"], "skype" => front::$_req["form"]["skype"], "login" => front::$_req["form"]["login"], "groupid" => front::$_req["form"]["groupid"], "additional" => front::$_req["form"]["additional"])); if (intval($id = front::$_req["id"]) > 0) { $aff = $db->update("UPDATE team_people SET ?s WHERE (id = ?n)", $save, $id); } else { $id = $db->insert("team_people", $save); } echo json_encode(array("success" => true, "id" => $id)); }
public function editRadzelAction() { $db = front::og('db'); $save = front::toWin(array('name' => front::$_req['title'])); if (intval($id = front::$_req['id']) > 0) { $aff = $db->update('UPDATE faq_category SET ?s WHERE (id = ?n)', $save, $id); } else { $id = $db->insert('faq_category', $save); } echo json_encode(array('success' => true, 'id' => $id)); }
function saveAction() { $db = front::og("db"); $save = front::toWin(array("title" => front::$_req["form"]["title"], "msg" => front::$_req["form"]["msg"], "id_blog" => 0, "id_user" => $_SESSION["uid"])); if (intval($id = front::$_req["id"]) > 0) { $aff = $db->update("UPDATE corporative_blog SET ?s WHERE (id = ?n)", $save, $id); } else { $id = $db->insert("corporative_blog", $save); } echo json_encode(array("success" => true, "id" => $id)); }
public function saveAction() { $db = front::og('db'); $save = front::toWin(array('title' => front::$_req['form']['title'], 'msg' => front::$_req['form']['msg'], 'id_blog' => 0, 'id_user' => $_SESSION['uid'])); if (intval($id = front::$_req['id']) > 0) { $aff = $db->update('UPDATE corporative_blog SET ?s WHERE (id = ?n)', $save, $id); } else { $id = $db->insert('corporative_blog', $save); } echo json_encode(array('success' => true, 'id' => $id)); }
public function saveAction() { $db = front::og('db'); $save = front::toWin(array('header' => front::$_req['form']['header'], 'n_text' => front::$_req['form']['n_text'], 'post_date' => front::$_req['form']['post_date'])); if (intval($id = front::$_req['id']) > 0) { $aff = $db->update('UPDATE news SET ?s WHERE (id = ?n)', $save, $id); } else { $id = $db->insert('news', $save); } echo json_encode(array('success' => true, 'id' => $id)); }
public function __construct() { parent::__construct(); /***********uid*******************/ $uid = isset($_GET['uid']) && intval($_GET['uid']) > 0 ? intval($_GET['uid']) : 0; //设置uid为request的数值 $uid = $uid > 0 ? $uid : $this->uid; $this->assign('uid', $uid); if (!$uid) { header('Location:/'); exit; } $thisUser = $this->user; $this->assign('user', $thisUser); /**********************************************************/ if ($this->uid == $uid) { $sub = '我'; $my = 1; } else { $sub = '他(她)'; $my = 0; } $this->uid = $uid; $this->assign('sub', $sub); $this->assign('my', $my); /*********************判断是不是各种经销商***************************/ $storeUserIndependent = 0; //经销商用户是否单独建表存储 if (intval(loadConfig('store', 'storeUserIndependent'))) { $storeUserIndependent = 1; //经销商用户是否单独建表存储 } if ($uid == $this->uid) { $this->assign('canManage', 1); } if ($uid == $this->uid && !$storeUserIndependent) { $store_db = bpBase::loadModel('store_model'); $is4sStore = 0; if ($store_db->select(array('storetype' => 1, 'uid' => $this->uid))) { $is4sStore = 1; } $this->assign('is4sStore', $is4sStore); //carRental $isRentalStore = 0; if ($store_db->select(array('storetype' => 3, 'uid' => $this->uid))) { $isRentalStore = 1; } $this->assign('isRentalStore', $isRentalStore); //ucar $ucar_store_db = bpBase::loadModel('usedcar_store_model'); $thisUcarStore = $ucar_store_db->select(array('uid' => $this->uid)); $this->assign('isUcarStore', $thisUcarStore ? 1 : 0); } }
function deleteimg_action() { if (!front::get('dir') || !front::get('imgname')) return; $img = ROOT . '/upload/images/' . front::get('dir') . '/' . str_replace('___', '.', front::get('imgname')); if (!file_exists($img)) front::flash('图片不存在'); if (!unlink($img)) front::flash('删除失败,请检查权限'); else front::flash('图片已删除'); front::redirect(url::modify('act/listimg/dir/' . front::get('dir'))); }