/**
  * Handler for user preferences form (preferences_list hook)
  */
 function prefs_list($args)
 {
     if ($args['section'] != 'mailbox') {
         return $args;
     }
     // Load configuration
     $this->load_config();
     // Load localization and configuration
     $this->add_texts('localization/');
     if (!empty($_REQUEST['_framed'])) {
         $this->rc->output->add_label('newmail_notifier.title', 'newmail_notifier.testbody', 'newmail_notifier.desktopunsupported', 'newmail_notifier.desktopenabled', 'newmail_notifier.desktopdisabled');
         $this->include_script('newmail_notifier.js');
     }
     // Check that configuration is not disabled
     $dont_override = (array) $this->rc->config->get('dont_override', array());
     foreach (array('basic', 'desktop', 'sound') as $type) {
         $key = 'newmail_notifier_' . $type;
         if (!in_array($key, $dont_override)) {
             $field_id = '_' . $key;
             $input = new html_checkbox(array('name' => $field_id, 'id' => $field_id, 'value' => 1));
             $content = $input->show($this->rc->config->get($key)) . ' ' . html::a(array('href' => '#', 'onclick' => 'newmail_notifier_test_' . $type . '()'), $this->gettext('test'));
             $args['blocks']['new_message']['options'][$key] = array('title' => html::label($field_id, Q($this->gettext($type))), 'content' => $content);
         }
     }
     return $args;
 }
Exemple #2
0
 /**
  * 采集页
  */
 public function parse()
 {
     // 类别
     $categorytop = M("category")->where(array("pid" => 0))->select();
     $this->assign("categorytop", $categorytop);
     // 采集
     if (Q("post.websiteText")) {
         $url = Q("post.websiteText");
         $update = Q("update");
         $collect = A("Data/Proxy/index", array($url, $update));
         $this->assign("collect", $collect);
         $update == "auto" ? $ufs = 1 : ($ufs = 0);
         $collect["auto_disabled"] ? $auto_disabled = 1 : ($auto_disabled = 0);
         Q("post.ctype") == "plural" ? $ctype = 1 : ($ctype = 0);
         Q("post.collection") ? $collection = 1 : ($collection = 0);
         $fs = array("update" => $ufs, "auto_disabled" => $auto_disabled, "ctype" => $ctype, "collection" => $collection);
         $website = $url;
     } else {
         $website = "请填入需采集的视频地址";
         $fs = array("update" => 0, "auto_disabled" => 0, "ctype" => 0, "collection" => 0);
     }
     if (Q("get.url")) {
         $yy_url = A("Data/Proxy/collect", array(Q("get.url")));
         $this->assign("yyurl", $yy_url);
     }
     if (!Q("session.username") && !Q("session.uid") && Q("session.group") != 1) {
         $readonly = true;
     } else {
         $readonly = false;
     }
     $this->assign("updatefs", $fs);
     $this->assign("readonly", $readonly);
     $this->assign("website", $website);
     $this->display();
 }
Exemple #3
0
 /**
  * 默认执行
  */
 public function index()
 {
     header("Content-type:text/xml;charset:utf-8;filename:M1905电影网代理.xml");
     // 定义文件头
     echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
     // 输出XML格式
     if ($id = Q("get.id")) {
         $xml = $this->cache_collect("m1905_" . $id);
         if ($xml != 1 && $xml) {
             echo $xml;
         } else {
             $xml = $this->listpage($id);
             $xml = $xml["xml"];
             if ($cachetime = Q("get.cachetime", null, "intval")) {
                 $this->cache_collect($id, 1, $xml, "m1905_", "file", $cachetime, ROOT_PATH . "Cache/Auto");
             } else {
                 $this->cache_collect($id, 1, $xml, "m1905_");
             }
             echo $xml;
         }
     } elseif (Q("get.vname")) {
         $vName = $this->listpage(Q("get.vname"));
         echo $vName["vName"];
     } else {
         $url = file_data('http://www.m1905.com/vod/rank/t0a99o3.shtml');
         $preg = '/<dt class="li03 oh"><a href="http:\\/\\/www.m1905.com\\/vod\\/info\\/(\\d{4,8})\\.shtml" target="_blank" title=".*" class=" pl28">.*<\\/a><\\/dt>/iUs';
         preg_match_all($preg, $url, $arr);
         $xml = "";
         foreach ($arr[1] as $value) {
             $lists = $this->listpage($value);
             $xml .= $lists["lists"];
         }
         echo "<list>\n" . $xml . '</list>';
     }
 }
Exemple #4
0
 public function sendEmail()
 {
     $username = Q('username');
     $email = Q('email');
     if (!$username || !$email) {
         $this->error('参数错误');
     } else {
         $Model = M('user');
         $user = $Model->where(array('username' => $username, 'email' => $email))->find();
         if (!$user) {
             $this->error('用户不存在');
         } else {
             $data = array();
             $data['uid'] = $user['uid'];
             $data['code'] = substr(md5(mt_rand(1, 1000) . time()), 0, 8);
             $newPassword = substr(md5(mt_rand(1, 1000) . time()), 0, 6);
             $data['password'] = md5($newPassword . $data['code']);
             $Model->save($data);
             $emailCon = "您在" . C('WEB_NAME') . "的新密码为:{$newPassword},请即刻修改密码!!!";
             $state = Mail::send($email, $user['username'], C('WEBNAME'), $emailCon);
             if ($state) {
                 $message = "我们已经向" . $email . '发送了重置密码邮件<br/>请登录邮箱查看新密码';
             } else {
                 $masterEmail = C('EMAIL');
                 $message = "邮件发送失败,请联系管理员<a href='mailto:{$masterEmail}'>{$masterEmail}</a>";
             }
         }
     }
     $this->assign('message', $message);
     $this->display();
 }
 public function checkEmail()
 {
     $email = Q("post.email");
     $this->db->where("uid<>{$_SESSION['user']['uid']}");
     echo $this->db->find("email='{$email}'") ? 0 : 1;
     exit;
 }
 /**
  * This callback function adds a box below the message content
  * if there is a vcard attachment available
  */
 function html_output($p)
 {
     $attach_script = false;
     $icon = 'plugins/vcard_attachments/' . $this->local_skin_path() . '/vcard_add_contact.png';
     foreach ($this->vcard_parts as $part) {
         $vcards = rcube_vcard::import($this->message->get_part_content($part, null, true));
         // successfully parsed vcards?
         if (empty($vcards)) {
             continue;
         }
         // remove part's body
         if (in_array($part, $this->vcard_bodies)) {
             $p['content'] = '';
         }
         foreach ($vcards as $idx => $vcard) {
             // skip invalid vCards
             if (empty($vcard->email) || empty($vcard->email[0])) {
                 continue;
             }
             $display = $vcard->displayname . ' <' . $vcard->email[0] . '>';
             // add box below message body
             $p['content'] .= html::p(array('class' => 'vcardattachment'), html::a(array('href' => "#", 'onclick' => "return plugin_vcard_save_contact('" . JQ($part . ':' . $idx) . "')", 'title' => $this->gettext('addvcardmsg')), html::span(null, Q($display))));
         }
         $attach_script = true;
     }
     if ($attach_script) {
         $this->include_script('vcardattach.js');
         $this->include_stylesheet($this->local_skin_path() . '/style.css');
     }
     return $p;
 }
 public function download()
 {
     $filename = Q('filename');
     $cid = Q('cid', 0, 'intval');
     if (empty($filename) || !$cid) {
         $this->error('参数错误');
     }
     $db = M('upload');
     $map['filename'] = array('EQ', $filename);
     $file = $db->where($map)->find();
     if (empty($file)) {
         $this->error('文件不存在');
     }
     $category = M('category')->find($cid);
     //不扣分
     if ($category['show_credits'] == 0) {
         header("Content-type:application/octet-stream");
         //二进制文件
         $fileName = $file['name'] . '.' . $file['ext'];
         //获得文件名
         header("Content-Disposition:attachment;filename={$fileName}");
         //下载窗口中显示的文件名
         header("Accept-ranges:bytes");
         //文件尺寸单位
         header("Accept-length:" . filesize($file['size']));
         //文件大小
         readfile($file['path']);
         //读出文件内容
     }
 }
Exemple #8
0
 /**
  * 默认执行
  */
 public function index()
 {
     header("Content-type:text/xml;charset:utf-8;filename:56代理.xml");
     // 定义文件头
     echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
     // 输出XML格式
     if ($id = Q("get.id")) {
         // 是否向地址栏传递URL参数
         $xml = $this->cache_collect("56_" . $id);
         if ($xml != 1 && $xml) {
             echo $xml;
         } else {
             if (preg_match("/^\\d{4,6}\$/iUs", $id)) {
                 $xml = $this->listpage($id);
             } else {
                 $xml = $this->one($id);
             }
             $xml = $xml["xml"];
             if ($cachetime = Q("get.cachetime", null, "intval")) {
                 $this->cache_collect($id, 1, $xml, "56_", "file", $cachetime, ROOT_PATH . "Cache/Auto");
             } else {
                 $this->cache_collect($id, 1, $xml, "56_");
             }
             echo $xml;
         }
     } elseif (Q("get.top")) {
         echo $this->top(Q("get.top"));
     } elseif (Q("get.vname")) {
         $vName = $this->listpage(Q("get.vname"));
         echo $vName["vName"];
     } else {
         // 没有向地址栏进行传递参数
         echo $this->top(1);
     }
 }
Exemple #9
0
 /**
  * 用户关注处理
  */
 public function follow()
 {
     $uid = Q('uid', 0, 'intval');
     if ($uid) {
         $username = M('user')->where('uid=' . $uid)->getField('username');
         $db = M('user_follow');
         $result = $db->where("uid={$uid} AND fans_uid={$_SESSION['uid']}")->find();
         if ($result) {
             //取消关注
             $db->where("uid={$uid} AND fans_uid={$_SESSION['uid']}")->del();
             $this->_ajax(1, array('message' => '取消关注成功', 'follow' => '关注'));
         } else {
             if ($db->add(array('uid' => $uid, 'fans_uid' => $_SESSION['uid']))) {
                 $Dlink = "<a target='_blank' href='?a=Member&c=Space&m=index&u={$uid}'>{$username}</a>";
                 //============记录动态
                 $UserDynamicModel = K('UserDynamic');
                 $UserDynamicModel->addDynamic('关注了' . $Dlink);
                 if ($db->where("uid={$_SESSION['uid']} AND fans_uid={$uid}")->find()) {
                     $this->_ajax(1, array('message' => '关注成功', 'follow' => '互相关注'));
                 } else {
                     $this->_ajax(1, array('message' => '关注成功', 'follow' => '已关注'));
                 }
             } else {
                 $this->_ajax(0, '操作失败');
             }
         }
     } else {
         $this->_ajax(0, '参数错误');
     }
 }
 /**
  * 首次登录
  */
 public function index()
 {
     if (!Q("session.UserInfo")) {
         $this->error("页面不存在!");
     }
     $this->display();
 }
Exemple #11
0
 public function login()
 {
     if (session('aid')) {
         go("Index/index");
     }
     if (IS_POST) {
         $username = Q("post.username");
         //对登录帐号的验证
         if (!($user = $this->_db->where("username='******'")->find())) {
             $this->error('帐号输入错误');
         }
         //对密码的验证
         if ($user['password'] != md5($_POST['password'])) {
             $this->error('密码输入错误');
         }
         //当帐号密码输入正确时记录登录状态
         $_SESSION['aid'] = $user['aid'];
         $_SESSION['username'] = $user['username'];
         //跳转到后台界面
         go('Index/index');
     } else {
         //显示登录界面
         $this->display();
     }
 }
 function gen_form()
 {
     list($form_start, $form_end) = get_form_tags(null, 'plugin.changepasswd_AD.save');
     // return the complete form as table
     $out = $form_start;
     $table = new html_table(array('cols' => 2));
     // show old password field
     $field_id = 'rcmfd_curpwd';
     $input_curpasswd = new html_passwordfield(array('name' => '_curpasswd', 'id' => $field_id));
     $table->add('title', html::label($field_id, Q($this->gettext('curpasswd'))));
     $table->add(null, $input_curpasswd->show());
     // show new password field
     $field_id = 'rcmfd_newpwd';
     $input_newpasswd = new html_passwordfield(array('name' => '_newpasswd', 'id' => $field_id));
     $table->add('title', html::label($field_id, Q($this->gettext('newpasswd'))));
     $table->add(null, $input_newpasswd->show());
     // show new password confirm field
     $field_id = 'rcmfd_cnfpwd';
     $input_confpasswd = new html_passwordfield(array('name' => '_confpasswd', 'id' => $field_id));
     $table->add('title', html::label($field_id, Q($this->gettext('confpasswd'))));
     $table->add(null, $input_confpasswd->show());
     $out .= $table->show();
     $out .= $form_end;
     return $out;
 }
 public function __init()
 {
     if (is_file(MODULE_PATH . 'Lock.php') && ACTION != 'isLock') {
         go('isLock');
     }
     $this->step = Q('step', 1, 'intval');
 }
Exemple #14
0
 /**
  * 登录
  */
 public function login()
 {
     if (!IS_POST) {
         $this->error("页面不存在!");
     }
     $username = Q("post.username");
     $pwd = Q("post.pwd", null, "md5");
     $user = K("user")->where(array("username" => $username))->field("password,userlock,uid,uuid,usergroup")->find();
     if (empty($user)) {
         $this->error("用户不存在!");
     }
     if ($pwd != $user["password"]) {
         $this->error("用户名或者密码错误!");
     }
     if ($user["userlock"]) {
         $this->error("您已经被锁定,请联系管理员!");
     }
     //$this->eve_exp($user["uid"]);
     $loginData = array("logintime" => time(), "loginip" => ip::getClientIp());
     $qqau = Q("post.qqau");
     if ($qqau) {
         $loginData["qqau"] = $qqau;
     }
     M("user")->where(array("uid" => $user["uid"]))->save($loginData);
     // p($_POST);
     $auto = Q("post.auto");
     if ($auto == "on") {
         setcookie(session_name(), session_id(), C("COOKIE_TIME"), "/");
     }
     session("username", $username);
     session("uid", $user["uid"]);
     session("uuid", $user["uuid"]);
     session("usergroup", $user["usergroup"]);
     $this->success("登录成功!正在跳转...");
 }
Exemple #15
0
 public function index()
 {
     $u = preg_replace('@[^\\w]@', '', Q('u'));
     $pre = C('DB_PREFIX');
     $sql = "SELECT uid,nickname,rname,r.rid,spec_num,credits,regtime,logintime,domain,icon FROM {$pre}user AS u\n                INNER JOIN {$pre}role AS r ON u.rid=r.rid\n                WHERE u.uid='{$u}' OR domain='{$u}'";
     if (!($user = M()->query($sql))) {
         _404('会员不存在');
     }
     $user = $user[0];
     //--------------------------增加空间访问次数
     if (!isset($_SESSION['uid']) or $_SESSION['uid'] != $user['uid']) {
         $sql = "UPDATE {$pre}user SET spec_num=spec_num+1";
         M()->exe($sql);
     }
     //---------------------------获得文章列表
     $where = 'uid=' . $user['uid'] . ' AND content_state=1 ';
     $db = M('content');
     $count = $db->where($where)->count();
     $page = new Page($count, 10);
     $data = $db->where($where)->limit($page->limit())->all();
     $this->data = $data;
     $this->page = $page->show();
     $this->user = $user;
     //------------------------------获得访问数据
     $guest = $this->getGuest($user['uid']);
     $this->assign('guest', $guest);
     $this->display();
 }
 function prefs_list($args)
 {
     if ($args['section'] == 'mailbox') {
         $RCMAIL = rcmail::get_instance();
         $field_id = 'rcmfd_html5_notifier';
         $select_duration = new html_select(array('name' => '_html5_notifier_duration', 'id' => $field_id));
         $select_duration->add($this->gettext('off'), '0');
         $times = array('3', '5', '8', '10', '12', '15', '20', '25', '30');
         foreach ($times as $time) {
             $select_duration->add($time . ' ' . $this->gettext('seconds'), $time);
         }
         $select_duration->add($this->gettext('durable'), '-1');
         $select_smbox = new html_select(array('name' => '_html5_notifier_smbox', 'id' => $field_id));
         $select_smbox->add($this->gettext('no_mailbox'), '0');
         $select_smbox->add($this->gettext('short_mailbox'), '1');
         $select_smbox->add($this->gettext('full_mailbox'), '2');
         $content = $select_duration->show($RCMAIL->config->get('html5_notifier_duration') . '');
         $content .= $select_smbox->show($RCMAIL->config->get('html5_notifier_smbox') . '');
         $content .= html::a(array('href' => '#', 'id' => 'rcmfd_html5_notifier_browser_conf', 'onclick' => 'rcmail_browser_notifications(); return false;'), $this->gettext('conf_browser')) . ' ';
         $content .= html::a(array('href' => '#', 'onclick' => 'rcmail_browser_notifications_test(); return false;'), $this->gettext('test_browser'));
         $args['blocks']['new_message']['options']['html5_notifier'] = array('title' => html::label($field_id, Q($this->gettext('shownotifies'))), 'content' => $content);
         $check_only_new = new html_checkbox(array('name' => '_html5_notifier_only_new', 'id' => $field_id . '_only_new', 'value' => 1));
         $content = $check_only_new->show($RCMAIL->config->get('html5_notifier_only_new', false));
         $args['blocks']['new_message']['options']['html5_notifier_only_new'] = array('title' => html::label($field_id, Q($this->gettext('onlynew'))), 'content' => $content);
         $field_id .= '_excluded';
         $input_excluded = new html_inputfield(array('name' => '_html5_notifier_excluded_directories', 'id' => $field_id));
         $args['blocks']['new_message']['options']['html5_notifier_excluded_directories'] = array('title' => html::label($field_id, Q($this->gettext('excluded_directories'))), 'content' => $input_excluded->show($RCMAIL->config->get('html5_notifier_excluded_directories') . ''));
         $RCMAIL->output->add_script("\$(document).ready(function(){ rcmail_browser_notifications_colorate(); });");
     }
     return $args;
 }
 /**
  *
  * 构造函数
  *
  * @param int $mid 模型mid
  */
 public function __construct($mid)
 {
     $this->mid = $mid;
     $this->cid = Q('cid', 0, 'intval');
     $this->field = S('field' . $this->mid);
     $this->category = S('category');
 }
 /**
  * 后台登录
  */
 public function index()
 {
     if (IS_POST) {
         //查找用户名
         $username = Q('post.username');
         $userData = M('user')->where("username='******'")->find();
         if (!$userData) {
             $this->error('用户名或密码错误');
         }
         if ($userData['is_admin'] == 0) {
             $this->error('没有管理员权限');
         }
         //比对密码
         if ($userData['password'] != Q('post.password', '', 'md5')) {
             $this->error('用户名或密码错误');
         }
         if (session('code') != Q('post.code', '', 'strtoupper')) {
             $this->error('验证码错误');
         }
         //登录成功存入session
         session('aname', $userData['username']);
         session('aid', $userData['uid']);
         $this->success('登录成功', U('Admin/Index/index'));
     }
     $this->display();
 }
Exemple #19
0
 public function __construct($podId)
 {
     $this->podId = $podId;
     //BAKERT what if there have been no completed matches/no pairings?
     $sql = 'SELECT SUM(pm1.wins) AS wins, SUM(pm2.wins) AS losses, ' . 'SUM(CASE WHEN pm1.wins > pm2.wins ' . 'THEN 3 ELSE (' . 'CASE WHEN pm1.wins = pm2.wins THEN 1 ELSE 0 END ' . ') END) AS points, ' . 'pe1.name AS name, pe1.url, pe1.player_id AS playerId ' . 'FROM `match` AS m ' . 'INNER JOIN round AS r ON r.id = m.round_id ' . 'INNER JOIN pod AS p ON p.id = r.pod_id ' . 'INNER JOIN player_match AS pm1 ON pm1.match_id = m.id ' . 'INNER JOIN player_match AS pm2 ON pm2.match_id = m.id ' . 'AND pm2.player_id != pm1.player_id ' . 'INNER JOIN player_event AS pe1 ON pe1.player_id = pm1.player_id AND pe1.event_id = p.event_id ' . 'LEFT JOIN player_event AS pe2 ON pe2.player_id = pm2.player_id AND pe2.event_id = p.event_id ' . 'WHERE r.pod_id = ' . Q($this->podId) . ' AND pm1.player_id != 0 ' . 'GROUP BY pm1.player_id ' . 'ORDER BY points DESC, SUM(pm1.wins - pm2.wins) DESC';
     $this->standings = D()->execute($sql);
 }
 public function delimage()
 {
     //接受图片路径
     $path = Q('post.p');
     //删除图片
     unlink($path);
 }
Exemple #21
0
 /**
  * 删除分类
  */
 public function del_type()
 {
     $tid = Q('tid', NULL, 'intval');
     $this->del($tid);
     $sql = "UPDATE " . C('DB_PREFIX') . "link SET tid=2 WHERE tid={$tid}";
     return $this->exe($sql);
 }
 public function __init()
 {
     $this->uid = Q('uid', 0, 'intval');
     if (empty($this->uid)) {
         $this->error('会员不存在');
     }
 }
 public function edit()
 {
     //修改分类
     if (IS_POST) {
         if (!$this->model->editCate()) {
             $this->error($this->model->error);
         }
         $this->success('修改成功', U('Category/index'));
     }
     $cid = Q('get.cid', 0, 'intval');
     //类型循环分配
     $type = M('type')->all();
     $this->assign('typeData', $type);
     //旧数据
     $oldCate = $this->model->where("cid={$cid}")->find();
     $this->assign('oldCate', $oldCate);
     //处理分类
     $allData = $this->model->all();
     $cid = Q('cid', 0, 'intval');
     $cids = $this->getSon($cid, $allData);
     $cids[] = $cid;
     $data = $this->model->where("cid NOT IN(" . implode(',', $cids) . ")")->all();
     $data = Data::tree($data, 'cname');
     $this->assign('data', $data);
     $this->display();
 }
 public function content()
 {
     $aid = Q('aid', 0, 'intval');
     if (!$aid) {
         $this->_404();
     }
     //验证阅读权限
     if (!Q('session.admin')) {
         $categoryAccessModel = M("category_access");
         $access = $categoryAccessModel->where(array('cid' => $this->cid, 'admin' => 0))->find();
         //栏目设置前台权限时验证
         if ($access) {
             //没有登录或没有权限
             if (!session('uid') || !isset($access[$_SESSION['rid']]) || !$access[$_SESSION['rid']]['show']) {
                 $this->error('没有访问权限');
             }
         }
     }
     $ContentModel = ContentViewModel::getInstance($this->mid);
     $field = $ContentModel->getOne($aid);
     if ($field['content_status'] == 0) {
         $this->error('文章正在审核中');
     }
     if (!$this->isCache()) {
         if ($field) {
             $this->assign('hdcms', $field);
             $tplFile = empty($field['template']) ? $this->category[$this->cid]['arc_tpl'] : $field['template'];
             $this->display('Template/' . C('WEB_STYLE') . '/' . $tplFile, C('CONTENT_CACHE_TIME'));
             exit;
         }
     } else {
         $this->display(null, C('CONTENT_CACHE_TIME'));
     }
 }
Exemple #25
0
 public function edit()
 {
     if (IS_POST) {
         $rid = Q("post.rid");
         $this->_db->where(array("rid" => $rid))->del();
         if (!empty($_POST['nid'])) {
             foreach ($_POST['nid'] as $v) {
                 $this->_db->add(array("rid" => $rid, "nid" => $v));
             }
         }
         $this->_ajax(1, '修改成功');
     } else {
         $rid = Q("rid");
         $sql = "SELECT n.nid,n.title,n.pid,n.type,a.rid as access_rid FROM hd_node AS n LEFT JOIN (SELECT * FROM (SELECT * FROM hd_access WHERE rid={$rid}) AS aa)AS a\n                ON n.nid = a.nid ORDER BY list_order ASC";
         $result = $this->_db->query($sql);
         foreach ($result as $n => $r) {
             $checked = $r['access_rid'] || $r['type'] == 2 ? " checked=''" : '';
             $disabled = $r['type'] == 2 ? 'disabled=""' : '';
             $result[$n]['checkbox'] = "<label><input type='checkbox' name='nid[]' value='{$r['nid']}' {$checked} {$disabled}/> {$r['title']}</label>";
         }
         $this->access = Data::channelLevel($result, 0, '-', 'nid');
         $this->rid = $rid;
         $this->display();
     }
 }
 /**
  * 注册
  */
 public function register()
 {
     if (IS_POST) {
         //验证输入内容
         if (!$this->model->re()) {
             $this->error($this->model->error);
         }
         //通过验证比对查找数据库注册邮箱是否已被注册
         $email = Q('post.email');
         $userData = $this->model->where("email='{$email}'")->find();
         if ($userData) {
             $this->error('邮箱已被注册');
         }
         //检验验证码输入是否正确
         $code = Q('post.code', 0, 'strtoupper');
         if (!$code == session('code')) {
             $this->error('验证码输入错误');
         }
         //组合数组插入数据库
         $data = array('email' => $email, 'password' => Q('post.password1', 0, 'md5'));
         $this->model->add($data);
         $this->success('注册成功', U('Index/index'));
     }
     $this->display('register');
 }
Exemple #27
0
 /**
  * 默认执行
  */
 public function index()
 {
     header("Content-type:text/xml;charset:utf-8;filename:风行代理.xml");
     // 定义文件头
     echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
     // 输出XML格式
     if ($id = Q("get.id")) {
         $xml = $this->cache_collect("funshion_" . $id);
         if ($xml != 1 && $xml) {
             echo $xml;
         } else {
             $xml = $this->listpage($id);
             $xml = $xml["xml"];
             if ($cachetime = Q("get.cachetime", null, "intval")) {
                 $this->cache_collect($id, 1, $xml, "funshion_", "file", $cachetime, ROOT_PATH . "Cache/Auto");
             } else {
                 $this->cache_collect($id, 1, $xml, "funshion_");
             }
             echo $xml;
         }
     } elseif (Q("get.vname")) {
         $vName = $this->listpage(Q("get.vname"));
         echo $vName["vName"];
     } else {
         $url = file_data('http://www.funshion.com/rank/fs250/');
         $preg = '/<\\/i><a href="(.*)" title="(.*)">.*<\\/a><span>/iUs';
         preg_match_all($preg, $url, $arr);
         foreach ($arr[1] as $value) {
             $lists = $this->listpage("http://www.funshion.com" . $value);
             $xml .= $lists["xml_m"];
         }
         echo "<list>\n" . $xml . '</list>';
     }
 }
 /**
  * This callback function adds a box below the message content
  * if there is a vcard attachment available
  */
 function html_output($p)
 {
     $attach_script = false;
     $icon = 'plugins/vcard_attachments/' . $this->local_skin_path() . '/vcard_add_contact.png';
     foreach ($this->vcard_parts as $part) {
         $vcards = rcube_vcard::import($this->message->get_part_content($part));
         // successfully parsed vcards?
         if (empty($vcards)) {
             continue;
         }
         // remove part's body
         if (in_array($part, $this->vcard_bodies)) {
             $p['content'] = '';
         }
         $style = 'margin:0.5em 1em; padding:0.2em 0.5em; border:1px solid #999; ' . 'border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; width: auto';
         foreach ($vcards as $idx => $vcard) {
             $display = $vcard->displayname;
             if ($vcard->email[0]) {
                 $display .= ' <' . $vcard->email[0] . '>';
             }
             // add box below messsage body
             $p['content'] .= html::p(array('style' => $style), html::a(array('href' => "#", 'onclick' => "return plugin_vcard_save_contact('" . JQ($part . ':' . $idx) . "')", 'title' => $this->gettext('addvcardmsg')), html::img(array('src' => $icon, 'style' => "vertical-align:middle"))) . ' ' . html::span(null, Q($display)));
         }
         $attach_script = true;
     }
     if ($attach_script) {
         $this->include_script('vcardattach.js');
     }
     return $p;
 }
Exemple #29
0
 function settings_table($args)
 {
     if ($args['section'] == 'mailbox') {
         $a_list_cols = rcmail::get_instance()->config->get('list_cols');
         $args['blocks']['roworder']['name'] = Q($this->gettext('roworder', 'msglistcols'));
         for ($i = 0; $i < 9; $i++) {
             $field_id = 'rcmfd_list_col' . $i;
             $select_col = new html_select(array('name' => '_list_cols[]', 'id' => $field_id));
             $select_col->add(rcube_label('skip', 'msglistcols'), '');
             $select_col->add(rcube_label('subject'), 'subject');
             $select_col->add(rcube_label('from'), 'from');
             $select_col->add(rcube_label('to'), 'to');
             $select_col->add(rcube_label('cc'), 'cc');
             $select_col->add(rcube_label('replyto'), 'replyto');
             $select_col->add(rcube_label('date'), 'date');
             $select_col->add(rcube_label('size'), 'size');
             $select_col->add(rcube_label('flagged', 'msglistcols'), 'flag');
             $select_col->add(rcube_label('attachment', 'msglistcols'), 'attachment');
             $args['blocks']['roworder']['options']['listcol_' . $i]['title'] = Q($this->gettext('list_col_' . $i, 'msglistcols'));
             if (!empty($a_list_cols[$i])) {
                 $selected = $a_list_cols[$i];
             } else {
                 $selected = "";
             }
             $args['blocks']['roworder']['options']['listcol_' . $i]['content'] = $select_col->show($selected);
             unset($select_col);
         }
     }
     return $args;
 }
 /**
  * 默认执行
  */
 public function index()
 {
     header('Content-type:text/xml;charset:utf-8;filename:城通网盘代理.xml');
     // 定义文件头
     echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
     // 输出XML格式
     if ($id = Q("get.id", null, "intval")) {
         $xml = $this->cache_collect("chengtong_" . $id);
         if ($xml != 1 && $xml) {
             echo $xml;
         } else {
             $xml = $this->listpage($id);
             $xml = $xml["xml"];
             if ($cachetime = Q("get.cachetime", null, "intval")) {
                 $this->cache_collect($id, 1, $xml, "chengtong_", "file", $cachetime, ROOT_PATH . "Cache/Auto");
             } else {
                 $this->cache_collect($id, 1, $xml, "chengtong_", 3600);
             }
             echo $xml;
         }
     } elseif (Q("get.vname")) {
         $vName = $this->listpage(Q("get.vname"));
         echo $vName["vName"];
     }
 }