Esempio n. 1
0
 public function __construct()
 {
     parent::__construct();
     if (self::$_saved === null) {
         self::$_saved = false;
     }
     if (self::$_need_save === null) {
         self::$_need_save = false;
     }
     $tmp = input()->cookie();
     if (array_count($tmp) > 0) {
         if (array_key_isset('PHPSESSID', $tmp)) {
             unset($tmp['PHPSESSID']);
         }
         if (array_count($tmp) > 0) {
             foreach ($tmp as $key => $val) {
                 if (is_varible_name($key)) {
                     if ($val != '') {
                         $this->_properties[$key] = unserialize(@gzuncompress(base64_decode($val)));
                     } else {
                         $this->_properties[$key] = '';
                     }
                 }
             }
         }
     }
     unset($tmp);
 }
Esempio n. 2
0
function msqmerge_menu($p, $o, $rid)
{
    $p = $p ? $p : msqmerge_default();
    $ret = input(1, 'inp', $p, '') . ' ';
    $ret .= lj('', $rid . '_plug__2_msqmerge_msqmerge*j___inp', picto('reload')) . ' ';
    return $ret;
}
 /**
  * 配置会员整合插件
  */
 public function setting()
 {
     if (IS_POST) {
         $code = input('post.code', 'trim');
         $mod = passport::uc($code);
         $info = $mod->get_info();
         foreach ($info['config'] as $key => $val) {
             $config[$key] = input('post.' . $key);
         }
         $config = serialize($config);
         //保存到配置表
         D('setting')->where(array('name' => 'integrate_code'))->setField('data', $code);
         D('setting')->where(array('name' => 'integrate_config'))->setField('data', $config);
         $this->success(L('operation_success'), U('integrate/index'));
     } else {
         $code = input('get.code', 'trim');
         $mod = passport::uc($code);
         //获取配置项
         $info = $mod->get_info();
         $this->assign('info', $info);
         //获取配置值
         $this->assign('icv', C('pin_integrate_config'));
         $this->display();
     }
 }
Esempio n. 4
0
 function display()
 {
     // Viewprofile
     if (input(1) && is_numeric(input(1))) {
         return $this->show_user();
     }
     // Action
     if (!user('logged')) {
         // Try to login
         if (input(1, 'login')) {
             return $this->login();
         }
     }
     if (user('logged') && input(1, 'logout')) {
         // Try to log-out
         return $this->logout();
     }
     # Final checks
     if (user('logged')) {
         #$GLOBALS['input'] = array ('user','profile','cnt');
         #return $this->profile ();
     } else {
         return $this->login();
     }
     // Else?
     @header('Location: ' . URL);
     exit;
 }
 /**
  * Prepares the form widget view data
  */
 public function prepareVars()
 {
     $sessionKey = input('sessionKey') ?: $this->sessionKey;
     $product = $this->model->product_id ? Product::findOrNew($this->model->product_id) : new Product();
     $this->vars['selectionIds'] = $this->model->selections()->lists('id');
     $this->vars['options'] = $product->options()->withDeferred($sessionKey)->get();
 }
Esempio n. 6
0
 /**
  * 设置路由
  */
 private function setconfig()
 {
     $route_config = get_config('route_config', 'default');
     $this->_m = input('m') ? input('m') : $route_config['m'];
     $this->_f = input('f') ? input('f') : $route_config['f'];
     $this->_v = input('v') ? strip_tags(input('v')) : $route_config['v'];
 }
 /**
  * 模板列表
  */
 public function index()
 {
     $config_file = APP_PATH . 'Home/Conf/config.php';
     $config = (include $config_file);
     if ($dirname = input('get.dirname', 'trim')) {
         //写入配置文件
         $config['DEFAULT_THEME'] = $dirname;
         file_put_contents($config_file, "<?php \nreturn " . var_export($config, true) . ";", LOCK_EX);
         $obj_dir = new \Common\ORG\Dir();
         is_dir(CACHE_PATH . 'Home/') && $obj_dir->delDir(CACHE_PATH . 'Home/');
         @unlink(RUNTIME_FILE);
     }
     $tpl_dir = APP_PATH . 'Home/View/';
     $opdir = dir($tpl_dir);
     $template_list = array();
     while (false !== ($entry = $opdir->read())) {
         if ($entry[0] == '.') {
             continue;
         }
         if (!is_file($tpl_dir . $entry . '/info.php')) {
             continue;
         }
         $info = (include_once $tpl_dir . $entry . '/info.php');
         $info['preview'] = basename(APP_PATH) . '/Home/View/' . $entry . '/preview.gif';
         $info['dirname'] = $entry;
         $template_list[$entry] = $info;
     }
     $this->assign('template_list', $template_list);
     //当前使用的模板
     $this->assign('def_tpl', $config['DEFAULT_THEME']);
     $this->display();
 }
Esempio n. 8
0
 protected function _search()
 {
     $map = array();
     ($keyword = input('request.keyword', 'trim')) && ($map['name'] = array('like', '%' . $keyword . '%'));
     $this->assign('search', array('keyword' => $keyword));
     return $map;
 }
function geturl($pfad)
{
    global $links;
    $r = split("/", trim($pfad, "/"));
    $in = input($links[$r[2]]['url']);
    return dlflv($in[$r[3]]['url']);
}
Esempio n. 10
0
/**
* Short Description
* Long
* Description
* @command check_registration
*/
function pestle_cli($argv)
{
    $path = 'app/code';
    if (count($argv) > 0) {
        $Path = $argv[0];
    }
    foreach (glob($path . '/*/*') as $file) {
        $parts = explode('/', $file);
        $module = implode('_', array_slice($parts, count($parts) - 2));
        $file = $file . '/' . 'registration.php';
        if (file_exists($file)) {
            output("Registration Exists");
            $contents = file_get_contents($file);
            if (strpos($contents, "'" . $module . "'") !== false) {
                output("Registration contains {$module} string");
                continue;
            }
            output("However, it's missing single quoted '{$module}' string");
            output("");
            continue;
        }
        output("No {$file}");
        $answer = input("Create? [Y/n]", 'n');
        if ($answer !== 'Y') {
            continue;
        }
        file_put_contents($file, templateRegistrationPhp($module));
        output("Created {$file}");
        output("");
    }
}
Esempio n. 11
0
function ossn_js_page_handler($pages)
{
    switch ($pages[0]) {
        case 'boot':
            if (!ossn_isLoggedIn()) {
                ossn_error_page();
            }
            if (isset($pages[1]) && $pages[1] == 'ossn.boot.chat.js') {
                header('Content-Type: application/javascript');
                echo ossn_plugin_view('js/OssnChat.Boot');
            }
            break;
        case 'selectfriend':
            $user = input('user');
            if (!empty($user)) {
                $user = ossn_user_by_guid($user);
                OssnChat::setUserChatSession($user);
                $friend['user'] = $user;
                echo ossn_plugin_view('chat/selectfriend', $friend);
            }
            break;
        default:
            ossn_error_page();
            break;
    }
}
Esempio n. 12
0
 public function log()
 {
     $zp = M('zhuanpan_list');
     $useracc = M('zhuanpan_log');
     if ($keyword = input('request.keyword', 'trim')) {
         $map['_string'] = "username like '%" . $keyword . "%' ";
     }
     $map['listid'] = array('lt', 7);
     $count = $useracc->where($map)->count();
     // 查询满足要求的总记录数 $map表示查询条件
     $Page = new \Common\ORG\Page($count);
     // 实例化分页类 传入总记录数
     $show = $Page->show();
     // 分页显示输出
     // 进行分页数据查询
     $list = $useracc->where($map)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
     foreach ($list as $key => $val) {
         $listid = $val['listid'];
         $listinfo = $zp->where("id={$listid}")->find();
         $list[$key]['jp_leibei'] = $listinfo['praisename'];
         $list[$key]['jp_name'] = $listinfo['praisecontent'];
     }
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $show);
     // 赋值分页输出
     $this->display();
 }
Esempio n. 13
0
 public function getArticle()
 {
     header('Content-type: application/json');
     $_out = array('status' => 'error', 'msg' => '参数错误!', 'eo' => '0');
     $keygen = input('keygen');
     $token = input('token');
     if ($keygen == '19890110001aFk5' && $token == 'yjmhntgbYyhGTByjghTG45H') {
         $limit = input('limit') ? input('limit') : 20;
         $order = input('order') ? input('order') : '';
         $configs = array('date' => input('date') ? input('order') : '', 'cid' => 4, 'has_pic' => input('has_pic') ? input('has_pic') : 0);
         $where = $this->_getWhere($configs);
         $sql = 'select * from task_contents ' . $where . 'order by created_time desc ' . 'limit ' . $limit;
         $data = get_data($sql);
         if (!empty($data)) {
             foreach ($data as $v) {
                 $_list[] = array('id' => $v['id'], 'title' => $v['title'], 'keywords' => $v['keywords'], 'description' => $v['description'], 'image' => $v['pic'], 'content' => $v['content'], 'hash' => $v['url_hash'], 'utc_time' => $v['created_time']);
             }
             $_out['list_data'] = $_list;
             $_out['status'] = 'success';
             $_out['msg'] = '成功获取数据';
         } else {
             $_out['msg'] = '暂无数据';
         }
     } else {
         $_out['msg'] = '验证错误';
     }
     echo json_encode($_out, true);
 }
Esempio n. 14
0
 /**
  * Get all books
  * if no limit specified, a default number 50 is filtered
  *
  * @return \Illuminate\Database\Eloquent\Collection|static[]
  */
 public function all()
 {
     $limit = input('limit', 50);
     $books = Book::all()->take($limit);
     event(new ExampleEvent());
     return $books;
 }
Esempio n. 15
0
 /**
  * Validate Captcha
  * @param $request
  * @return bool
  */
 private function validateCaptcha(Request $request)
 {
     // validate google captcha
     $recaptcha = new ReCaptcha(env('RECAPTCHA_PRIVATE_KEY'));
     $response = $recaptcha->verify(input('g-recaptcha-response'), $request->getClientIp());
     return $response;
 }
Esempio n. 16
0
 public function __construct($companyId = null)
 {
     parent::__construct();
     if ($companyId !== null) {
         $this->company = Company::instance()->find($companyId);
     } else {
         $this->company = new Company();
     }
     $this->exists = $this->company->exists();
     if ($this->exists) {
         $this->prependSiteTitle(lang('Companies.EditCompany', $this->company->name));
     } else {
         $this->prependSiteTitle(lang('Companies.AddCompany'));
     }
     if ($this->isPostBack()) {
         $this->validate(['name' => [new NotNullOrEmpty()]]);
         if (!$this->hasErrors()) {
             $this->company->save(['name' => input()->get('name'), 'ip' => request()->getIp()]);
             if ($this->exists) {
                 $this->setMessage(lang('Companies.CompanyUpdated'), 'success');
             } else {
                 $this->setMessage(lang('Companies.CompanySaved'), 'success');
             }
             // Refresh
             response()->refresh();
         }
     }
 }
Esempio n. 17
0
function ossn_search_page($pages)
{
    $page = $pages[0];
    if (empty($page)) {
        $page = 'search';
    }
    ossn_trigger_callback('page', 'load:search');
    switch ($page) {
        case 'search':
            $query = input('q');
            $type = input('type');
            $title = ossn_print("search:result", array($query));
            if (empty($type)) {
                $params['type'] = 'users';
            } else {
                $params['type'] = $type;
            }
            $type = $params['type'];
            if (ossn_is_hook('search', "type:{$type}")) {
                $contents['contents'] = ossn_call_hook('search', "type:{$type}", array('q' => input('q')));
            }
            $contents = array('content' => ossn_plugin_view('search/pages/search', $contents));
            $content = ossn_set_page_layout('search', $contents);
            echo ossn_view_page($title, $content);
            break;
        default:
            ossn_error_page();
            break;
    }
}
Esempio n. 18
0
 function run_api()
 {
     if (@$_GET['a'] == 'init') {
         return $this->init();
     }
     if (@$_GET['a'] == 'check') {
         return $this->check();
     }
     if (!$this->check_sid(0)) {
         return $this->error('SID_ERROR', 'Invalid session - restart your program');
     }
     include_once CORE_PATH . '/ttl.php';
     if (@$_GET['a'] == 'client-update') {
         return $this->soft_update();
     }
     if (@$_GET['a'] == 'upload-done' || input(1, 'upload-done')) {
         return $this->upload_complete();
     }
     if (@$_GET['a'] == 'update') {
         return $this->update();
     }
     if (@$_GET['a'] == 'delete') {
         return $this->delete();
     }
     return $this->error('UNK_METHOD', "Unknown API Method");
 }
Esempio n. 19
0
function plug_calendar($p, $o)
{
    $rid = 'plg' . randid();
    $ret = calendar_build($p, 'res');
    $bt = input(1, 'res', '');
    return $bt . divd($rid, $ret);
}
Esempio n. 20
0
 public function clear()
 {
     $type = input('get.type', 'trim');
     $obj_dir = new \Common\ORG\Dir();
     switch ($type) {
         case 'field':
             is_dir(DATA_PATH . '_fields/') && $obj_dir->del(DATA_PATH . '_fields/');
             break;
         case 'tpl':
             is_dir(CACHE_PATH) && $obj_dir->delDir(CACHE_PATH);
             break;
         case 'data':
             is_dir(DATA_PATH) && $obj_dir->del(DATA_PATH);
             is_dir(TEMP_PATH) && $obj_dir->delDir(TEMP_PATH);
             break;
         case 'runtime':
             if (is_file(RUNTIME_FILE)) {
                 unlink(RUNTIME_FILE);
             }
             break;
         case 'logs':
             is_dir(LOG_PATH) && $obj_dir->delDir(LOG_PATH);
             break;
         case 'js':
             is_dir(PIN_DATA_PATH . '/static/') && $obj_dir->del(PIN_DATA_PATH . '/static/');
             break;
     }
     $this->ajaxReturn(1);
 }
Esempio n. 21
0
 protected function gitBranch()
 {
     if (!($name = input('branch-name'))) {
         return null;
     }
     return $this->exec('checkout', $name);
 }
Esempio n. 22
0
function form($objectName, $object, $options = array())
{
    if (!isset($options['action'])) {
        if ($object->isNewRecord()) {
            $options['action'] = 'create';
        } else {
            $options['action'] = 'update';
        }
    }
    if (!isset($options['submit_value'])) {
        $options['submit_value'] = ucfirst($options['action']);
    }
    if (isset($options['multipart']) && $options['multipart'] === true) {
        $form = form_tag(array('action' => $options['action']), array('multipart' => true));
    } else {
        $form = form_tag(array('action' => $options['action']));
    }
    if (!$object->isNewRecord()) {
        $form .= hidden_field($objectName, 'id', $object);
    }
    $fields = $object->contentAttributes();
    foreach ($fields as $attr) {
        $form .= '<p><label for="' . $objectName . '_' . $attr->name . '">' . SInflection::humanize($attr->name) . "</label>\n" . input($objectName, $attr->name, $object) . "</p>\n";
    }
    if (isset($options['include'])) {
        $form .= $options['include'];
    }
    $form .= submit_tag($options['submit_value']);
    $form .= end_form_tag();
    return $form;
}
Esempio n. 23
0
 public function log()
 {
     $useracc = M('user_acclog');
     if ($keyword = input('request.keyword', 'trim')) {
         $map['_string'] = "username like '%" . $keyword . "%' ";
     }
     if ($fl = input('request.fl', 'trim')) {
         if (!empty($fl)) {
             $map['fl'] = $fl;
         }
     }
     $count = $useracc->where($map)->count();
     // 查询满足要求的总记录数 $map表示查询条件
     $Page = new \Common\ORG\Page($count);
     // 实例化分页类 传入总记录数
     $show = $Page->show();
     // 分页显示输出
     // 进行分页数据查询
     $list = $useracc->where($map)->order('logid desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $show);
     // 赋值分页输出
     $this->display();
 }
Esempio n. 24
0
File: mysqm.php Progetto: philum/cms
function plug_mysqm($p, $o)
{
    $p = $p ? $p : db;
    $ret .= input(1, 'inp', $p, '') . ' ';
    $ret .= lj('', 'mqm_plug__2_mysqm_mq*tables___inp', picto('reload')) . ' ';
    //$ret.=msqlink('',ses('qb').'_msqm').' ';
    return $ret . divd('mqm', mq_tables($p, $o));
}
 public function update($id)
 {
     $companyModel = new Company();
     $company = $companyModel->findOrfail($id);
     $company->name = input()->get('name');
     $company->save();
     $this->show($company->id);
 }
 public function testBasicInputTagWithError()
 {
     $this->post->errors['title'] = 'Error !';
     $this->post->contentAttributes = array(new SAttribute('title', 'string'));
     $this->assertDomEqual(input('post', 'title', $this->post), '<div class="field-with-errors">
         <input type="text" name="post[title]" value="PHP for ever" id="post_title" size="30" />
         </div>');
 }
Esempio n. 27
0
 public function language($locale = null)
 {
     if (in_array(strtolower($locale), Helper::$Locales)) {
         Cookie::create('Locale', strtolower($locale));
     }
     $path = input()->get('path', '');
     redirect('/#' . $path);
 }
Esempio n. 28
0
 /**
  * Process the split test campaign when a CMS object is saved
  *
  * @param   IndexController     $controller
  * @param   array               $data
  */
 public static function beforeSave(IndexController $controller, array $data)
 {
     $campaign = array_key_exists('id', $data) ? Campaign::firstOrNew(['id' => $data['id']]) : new Campaign();
     $campaign->file_name = input('fileName');
     $campaign->file_type = input('templateType');
     $campaign->fill($data);
     $campaign->save();
 }
Esempio n. 29
0
 protected function rsyncUpload()
 {
     try {
         return (new Repository\Rsync())->upload(input('files'));
     } catch (Exception $e) {
         return array('error' => $e->getMessage());
     }
 }
function geturl($pfad)
{
    global $links, $video_type;
    $r = explode("/", trim($pfad, "/"));
    $in = input($links[$r[2]]['url']);
    $t = stripslashes($r[3]);
    return spiegeltv_getvideo_url($in[$t]['videoid'], $video_type);
}