当前位置: 首页>>代码示例>>PHP>>正文


PHP Get::i方法代码示例

本文整理汇总了PHP中Get::i方法的典型用法代码示例。如果您正苦于以下问题:PHP Get::i方法的具体用法?PHP Get::i怎么用?PHP Get::i使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Get的用法示例。


在下文中一共展示了Get::i方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handler_panel

 function handler_panel($page)
 {
     $page->changeTpl('carnet/panel.tpl');
     if (Get::has('read')) {
         XDB::execute('UPDATE  watch
                          SET  last = FROM_UNIXTIME({?})
                        WHERE  uid = {?}', Get::i('read'), S::i('uid'));
         S::user()->invalidWatchCache();
         Platal::session()->updateNbNotifs();
         pl_redirect('carnet/panel');
     }
     require_once 'notifs.inc.php';
     $page->assign('now', time());
     $user = S::user();
     $notifs = Watch::getEvents($user, time() - 7 * 86400);
     $page->assign('notifs', $notifs);
     $page->assign('today', date('Y-m-d'));
     $this->_add_rss_link($page);
 }
开发者ID:Ekleog,项目名称:platal,代码行数:19,代码来源:carnet.php

示例2: doAuth

 protected function doAuth($level)
 {
     if (S::identified()) {
         // Nothing to do there
         return User::getSilentWithValues(null, array('uid' => S::i('uid')));
     }
     if (!Get::has('auth')) {
         return null;
     }
     global $globals;
     if (md5('1' . S::v('challenge') . $globals->xnet->secret . Get::i('uid') . '1') != Get::v('auth')) {
         return null;
     }
     Get::kill('auth');
     S::set('auth', AUTH_PASSWD);
     return User::getSilentWithValues(null, array('uid' => Get::i('uid')));
 }
开发者ID:Ekleog,项目名称:platal,代码行数:17,代码来源:xnetsession.php

示例3: handler_register

 function handler_register($page, $hash = null)
 {
     $page->forceSkin('register');
     $alert = array();
     $alert_details = '';
     $subState = new PlDict(S::v('subState', array()));
     if (!$subState->has('step')) {
         $subState->set('step', 0);
     }
     if (!$subState->has('backs')) {
         $subState->set('backs', new PlDict());
     }
     if (Get::has('back') && Get::i('back') < $subState->i('step')) {
         $subState->set('step', max(0, Get::i('back')));
         $subState->v('backs')->set($subState->v('backs')->count() + 1, $subState->dict());
         $subState->v('backs')->kill('backs');
         if ($subState->v('backs')->count() == 3) {
             $alert[] = "Tentative d'inscription très hésitante";
             $alert_details .= "\n   * Retours en arrières : 3.";
         }
     }
     if ($hash) {
         $res = XDB::query("SELECT  a.uid, a.hruid, ppn.lastname_initial AS lastname, ppn.firstname_initial AS firstname, p.xorg_id AS xorgid,\n                                       pd.promo, pe.promo_year AS yearpromo, pde.degree AS edu_type,\n                                       p.birthdate_ref AS birthdateRef, FIND_IN_SET('watch', a.flags) AS watch, m.hash, a.type, a.comment\n                                 FROM  register_marketing AS m\n                           INNER JOIN  accounts           AS a   ON (m.uid = a.uid)\n                           INNER JOIN  account_profiles   AS ap  ON (a.uid = ap.uid AND FIND_IN_SET('owner', ap.perms))\n                           INNER JOIN  profiles           AS p   ON (p.pid = ap.pid)\n                           INNER JOIN  profile_display    AS pd  ON (p.pid = pd.pid)\n                           INNER JOIN  profile_education  AS pe  ON (pe.pid = p.pid AND FIND_IN_SET('primary', pe.flags))\n                           INNER JOIN  profile_education_degree_enum AS pde ON (pde.id = pe.degreeid)\n                           INNER JOIN  profile_public_names AS ppn ON (ppn.pid = p.pid)\n                                WHERE  m.hash = {?} AND a.state = 'pending'", $hash);
         if ($res->numRows() == 1) {
             $subState->merge($res->fetchOneRow());
             $subState->set('main_mail_domain', User::$sub_mail_domains[$subState->v('type')]);
             XDB::execute('INSERT INTO  register_mstats (uid, sender, success)
                                SELECT  m.uid, m.sender, 0
                                  FROM  register_marketing AS m
                                 WHERE  m.hash
               ON DUPLICATE KEY UPDATE  sender = VALUES(sender), success = VALUES(success)', $subState->s('hash'));
         }
     }
     switch ($subState->i('step')) {
         case 0:
             $wp = new PlWikiPage('Reference.Charte');
             $wp->buildCache();
             if (Post::has('step1')) {
                 $subState->set('step', 1);
                 if ($subState->has('hash')) {
                     $subState->set('step', 3);
                     $this->load('register.inc.php');
                     createAliases($subState);
                 }
             }
             break;
         case 1:
             if (Post::has('yearpromo')) {
                 $edu_type = Post::t('edu_type');
                 $yearpromo = Post::i('yearpromo');
                 $promo = Profile::$cycle_prefixes[$edu_type] . $yearpromo;
                 $res = XDB::query("SELECT  COUNT(*)\n                                         FROM  accounts         AS a\n                                   INNER JOIN  account_profiles AS ap ON (a.uid = ap.uid AND FIND_IN_SET('owner', ap.perms))\n                                   INNER JOIN  profiles         AS p  ON (p.pid = ap.pid)\n                                   INNER JOIN  profile_education AS pe ON (pe.pid = p.pid AND FIND_IN_SET('primary', pe.flags))\n                                        WHERE  a.state = 'pending' AND p.deathdate IS NULL AND pe.promo_year = {?}", $yearpromo);
                 if (!$res->fetchOneCell()) {
                     $error = 'La promotion saisie est incorrecte ou tous les camarades de cette promotion sont inscrits !';
                 } else {
                     $subState->set('step', 2);
                     $subState->set('promo', $promo);
                     $subState->set('yearpromo', $yearpromo);
                     $subState->set('edu_type', $edu_type);
                     if ($edu_type == Profile::DEGREE_X) {
                         if ($yearpromo >= 1996 && $yearpromo < 2000) {
                             $subState->set('schoolid', $yearpromo % 100 * 10 . '???');
                             $subState->set('schoolid_exemple', $yearpromo % 100 * 10000 + 532);
                             $subState->set('schoolid_exemple_ev2', ($yearpromo + 1) % 100 * 10000 + 532);
                         } elseif ($yearpromo >= 2000) {
                             $subState->set('schoolid', 100 + $yearpromo % 100 . '???');
                             $subState->set('schoolid_exemple', (100 + $yearpromo % 100) * 1000 + 532);
                             $subState->set('schoolid_exemple_ev2', (100 + ($yearpromo + 1) % 100) * 1000 + 532);
                         }
                     }
                 }
             }
             break;
         case 2:
             if (count($_POST)) {
                 $this->load('register.inc.php');
                 $subState->set('firstname', Post::t('firstname'));
                 $subState->set('lastname', Post::t('lastname'));
                 if (Post::has('schoolid')) {
                     $subState->set('schoolid', Post::i('schoolid'));
                 }
                 $error = checkNewUser($subState);
                 if ($error !== true) {
                     break;
                 }
                 $error = createAliases($subState);
                 if ($error === true) {
                     unset($error);
                     $subState->set('step', 3);
                 }
             }
             break;
         case 3:
             if (count($_POST)) {
                 $this->load('register.inc.php');
                 // Validate the email address format and domain.
                 require_once 'emails.inc.php';
                 $user = User::get($subState->s('uid'));
                 if (!isvalid_email(Post::v('email'))) {
                     $error[] = "Le champ 'Email' n'est pas valide.";
//.........这里部分代码省略.........
开发者ID:Ekleog,项目名称:platal,代码行数:101,代码来源:register.php

示例4: handler_moderate

 function handler_moderate($page, $liste = null)
 {
     if (is_null($liste)) {
         return PL_NOT_FOUND;
     }
     $mlist = $this->prepare_list($liste);
     if (!$this->is_group_admin($page)) {
         $this->verify_list_owner($page, $mlist);
     }
     $page->changeTpl('lists/moderate.tpl');
     $page->register_modifier('hdc', 'list_header_decode');
     if (Env::has('sadd') || Env::has('sdel')) {
         S::assert_xsrf_token();
         if (Env::has('sadd')) {
             // Ensure the moderated request is still active
             $sub = $mlist->getPendingSubscription(Env::v('sadd'));
             $mlist->handleRequest(MailingList::REQ_SUBSCRIBE, Env::v('sadd'));
             $info = "validée";
         }
         if (Post::has('sdel')) {
             // Ensure the moderated request is still active
             $sub = $mlist->getPendingSubscription(Env::v('sdel'));
             $mlist->handleRequest(MailingList::REQ_REJECT, Post::v('sdel'), Post::v('reason'));
             $info = "refusée";
         }
         if ($sub) {
             $mailer = new PlMailer();
             $mailer->setFrom($mlist->getAddress(MailingList::KIND_BOUNCE));
             $mailer->addTo($mlist->getAddress(MailingList::KIND_OWNER));
             $mailer->addHeader('Reply-To', $mlist->getAddress(MailingList::KIND_OWNER));
             $mailer->setSubject("L'inscription de {$sub['name']} a été {$info}");
             $text = "L'inscription de {$sub['name']} à la liste " . $mlist->address . " a été {$info} par " . S::user()->fullName(true) . ".\n";
             if (trim(Post::v('reason'))) {
                 $text .= "\nLa raison invoquée est :\n" . Post::v('reason');
             }
             $mailer->setTxtBody(wordwrap($text, 72));
             $mailer->send();
         }
         if (Env::has('sadd')) {
             pl_redirect('lists/moderate/' . $liste);
         }
     }
     if (Post::has('moderate_mails') && Post::has('select_mails')) {
         S::assert_xsrf_token();
         $mails = array_keys(Post::v('select_mails'));
         foreach ($mails as $mail) {
             $this->moderate_mail($mlist, $mail);
         }
     } elseif (Env::has('mid')) {
         if (Get::has('mid') && !Env::has('mok') && !Env::has('mdel')) {
             require_once 'banana/moderate.inc.php';
             $page->changeTpl('lists/moderate_mail.tpl');
             $params = array('listname' => $mlist->mbox, 'domain' => $mlist->domain, 'artid' => Get::i('mid'), 'part' => Get::v('part'), 'action' => Get::v('action'));
             $params['client'] = $this->prepare_client();
             run_banana($page, 'ModerationBanana', $params);
             $msg = file_get_contents('/etc/mailman/fr/refuse.txt');
             $msg = str_replace("%(adminaddr)s", $mlist->getAddress(MailingList::KIND_OWNER), $msg);
             $msg = str_replace("%(request)s", "<< SUJET DU MAIL >>", $msg);
             $msg = str_replace("%(reason)s", "<< TON EXPLICATION >>", $msg);
             $msg = str_replace("%(listname)s", $liste, $msg);
             $page->assign('msg', $msg);
             return;
         }
         $this->moderate_mail($mlist, Env::i('mid'));
     } elseif (Env::has('sid')) {
         if (list($subs, $mails) = $this->get_pending_ops($mlist)) {
             foreach ($subs as $user) {
                 if ($user['id'] == Env::v('sid')) {
                     $page->changeTpl('lists/moderate_sub.tpl');
                     $page->assign('del_user', $user);
                     return;
                 }
             }
         }
     }
     if (list($subs, $mails) = $this->get_pending_ops($mlist)) {
         foreach ($mails as $key => $mail) {
             $mails[$key]['stamp'] = strftime("%Y%m%d%H%M%S", $mail['stamp']);
             if ($mail['fromx']) {
                 $page->assign('with_fromx', true);
             } else {
                 $page->assign('with_nonfromx', true);
             }
         }
         $page->assign_by_ref('subs', $subs);
         $page->assign_by_ref('mails', $mails);
     } else {
         $page->kill("La liste n'existe pas ou tu n'as pas le droit de la modérer.");
     }
 }
开发者ID:Ekleog,项目名称:platal,代码行数:90,代码来源:lists.php

示例5: handler_xnet_payment

 function handler_xnet_payment($page, $pid = null)
 {
     global $globals;
     $perms = S::v('perms');
     if (is_null($pid)) {
         if (!(S::identified() && $perms->hasFlag('groupadmin'))) {
             return PL_FORBIDDEN;
         }
     } else {
         if (!(S::identified() && $perms->hasFlag('groupmember'))) {
             $res = XDB::query("SELECT  1\n                                     FROM  group_events AS e\n                               INNER JOIN  group_event_participants AS ep ON (ep.eid = e.eid AND ep.uid = {?})\n                                    WHERE  e.paiement_id = {?} AND e.asso_id = {?}", S::i('uid'), $pid, $globals->asso('id'));
             $public = XDB::query("SELECT  1\n                                        FROM  payments     AS p\n                                  INNER JOIN  group_events AS g ON (g.paiement_id = p.id)\n                                       WHERE  g.asso_id = {?} AND p.id = {?} AND FIND_IN_SET('public', p.flags)", $globals->asso('id'), $pid);
             if ($res->numRows() == 0 && $public->numRows() == 0) {
                 return PL_FORBIDDEN;
             }
         }
     }
     if (!is_null($pid)) {
         return $this->handler_payment($page, $pid);
     }
     $page->changeTpl('payment/xnet.tpl');
     $res = XDB::query("SELECT  id, text, url\n                   FROM  payments\n                  WHERE  asso_id = {?} AND NOT FIND_IN_SET('old', flags)\n               ORDER BY  id DESC", $globals->asso('id'));
     $tit = $res->fetchAllAssoc();
     $page->assign('titles', $tit);
     $trans = array();
     $event = array();
     if (may_update()) {
         static $orders = array('ts_confirmed' => 'p', 'directory_name' => 'a', 'promo' => 'pd', 'comment' => 'p', 'amount' => 'p');
         if (Get::has('order_id') && Get::has('order') && array_key_exists(Get::v('order'), $orders)) {
             $order_id = Get::i('order_id');
             $order = Get::v('order');
             $ordering = ' ORDER BY ' . $orders[$order] . '.' . $order;
             if (Get::has('order_inv') && Get::i('order_inv') == 1) {
                 $ordering .= ' DESC';
                 $page->assign('order_inv', 0);
             } else {
                 $page->assign('order_inv', 1);
             }
             $page->assign('order_id', $order_id);
             $page->assign('order', $order);
             $page->assign('anchor', 'legend_' . $order_id);
         } else {
             $order_id = false;
             $ordering = '';
             $page->assign('order', false);
         }
     } else {
         $ordering = '';
         $page->assign('order', false);
     }
     foreach ($tit as $foo) {
         $pid = $foo['id'];
         if (may_update()) {
             $res = XDB::query('SELECT  p.uid, IF(p.ts_confirmed = \'0000-00-00\', 0, p.ts_confirmed) AS date, p.comment, p.amount
                                  FROM  payment_transactions AS p
                            INNER JOIN  accounts             AS a  ON (a.uid = p.uid)
                             LEFT JOIN  account_profiles     AS ap ON (ap.uid = p.uid AND FIND_IN_SET(\'owner\', ap.perms))
                             LEFT JOIN  profile_display      AS pd ON (ap.pid = pd.pid)
                                 WHERE  p.ref = {?}' . ($order_id == $pid ? $ordering : ''), $pid);
             $trans[$pid] = User::getBulkUsersWithUIDs($res->fetchAllAssoc(), 'uid', 'user');
             $sum = 0;
             foreach ($trans[$pid] as $i => $t) {
                 $sum += $t['amount'];
                 $trans[$pid][$i]['amount'] = $t['amount'];
             }
             $trans[$pid][] = array('limit' => true, 'amount' => $sum);
         }
         $res = XDB::iterRow("SELECT  e.eid, e.short_name, e.intitule, ep.nb, ei.montant, ep.paid\n                                   FROM  group_events             AS e\n                              LEFT JOIN  group_event_participants AS ep ON (ep.eid = e.eid AND ep.uid = {?})\n                             INNER JOIN  group_event_items        AS ei ON (ep.eid = ei.eid AND ep.item_id = ei.item_id)\n                                  WHERE  e.paiement_id = {?}", S::v('uid'), $pid);
         $event[$pid] = array();
         $event[$pid]['paid'] = 0;
         if ($res->total()) {
             $event[$pid]['topay'] = 0;
             while (list($eid, $shortname, $title, $nb, $montant, $paid) = $res->next()) {
                 $event[$pid]['topay'] += $nb * $montant;
                 $event[$pid]['eid'] = $eid;
                 $event[$pid]['shortname'] = $shortname;
                 $event[$pid]['title'] = $title;
                 $event[$pid]['ins'] = !is_null($nb);
                 $event[$pid]['paid'] = $paid;
             }
         }
         $res = XDB::query('SELECT  SUM(amount) AS sum_amount
                              FROM  payment_transactions
                             WHERE  ref = {?} AND uid = {?}', $pid, S::v('uid'));
         $event[$pid]['paid'] = $res->fetchOneCell();
     }
     $page->register_modifier('decode_comment', 'decode_comment');
     $page->assign('trans', $trans);
     $page->assign('event', $event);
 }
开发者ID:Ekleog,项目名称:platal,代码行数:90,代码来源:payment.php


注:本文中的Get::i方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。