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


PHP Generic::guestOnly方法代码示例

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


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

示例1: sprintf

 function __construct()
 {
     // Only allow guests to view this page
     parent::guestOnly();
     /* Has the admin disabled user registrations? */
     $disable = parent::getOption('disable-registrations-enable');
     if ($disable) {
         $this->error = sprintf('<div class="alert alert-block alert-error">%s</div>', _('<h4 class="alert-heading">Registrations disabled.</h4><p>Already have an account? <a href="login.php">Sign in here</a>!</p>'));
         parent::displayMessage($this->error, true);
     }
     $this->use_emails = parent::getOption('email-as-username-enable');
     $this->username_type = $this->use_emails ? 'email' : 'username';
     // jQuery form validation
     parent::checkExists();
     // Generate a unique token for security purposes
     parent::generateToken();
     // Has the form been submitted?
     if (!empty($_POST)) {
         // Sign up form post data
         foreach ($_POST as $field => $value) {
             $this->settings[$field] = parent::secure($value);
         }
         $this->process();
     }
     if (isset($_GET['new_social'])) {
         $this->error = sprintf('<div class="alert alert-success">%s</div>', _('We don\'t see you as a registered user. Perhaps you\'d like to sign up :)'));
     }
     parent::displayMessage($this->error, false);
 }
开发者ID:fliptechit,项目名称:kick-notify,代码行数:29,代码来源:signup.class.php

示例2: process

 public function process()
 {
     // Only allow guests to view this page
     parent::guestOnly();
     // Check for correct and complete values
     $this->validate();
     // If there are no errors, let's reset the password
     $this->resetpw();
     // Show the form if $_GET key is set
     $this->reset_form();
 }
开发者ID:causefx,项目名称:MMHTPC-ManageMyHTPC,代码行数:11,代码来源:forgot.class.php


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