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


PHP Auth::LoggedIn方法代码示例

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


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

示例1: index

 public function index()
 {
     if (!Auth::LoggedIn()) {
         echo 'You must be logged in to access this page!';
         return;
     }
     $this->set('allcategories', DownloadData::GetAllCategories());
     $this->render('downloads_list.tpl');
 }
开发者ID:Galihom,项目名称:phpVMS,代码行数:9,代码来源:Downloads.php

示例2: jumpseat

 public function jumpseat()
 {
     if (!Auth::LoggedIn()) {
         $this->set('message', 'You must be logged in to access this feature!');
         $this->render('core_error.tpl');
         return;
     } else {
         $icao = DB::escape($this->post->depicao);
         $this->set('airport', OperationsData::getAirportInfo($icao));
         $this->set('cost', DB::escape($this->post->cost));
         $this->show('Fltbook/jumpseatticket');
     }
 }
开发者ID:web541,项目名称:FltbookSystem,代码行数:13,代码来源:Fltbook.php

示例3: login

 public function login($redir = '')
 {
     if (Auth::LoggedIn() == true) {
         $this->render('login_already.tpl');
         return;
     }
     $this->set('redir', $redir);
     if (isset($this->post->action) && $this->post->action == 'login') {
         $this->ProcessLogin();
     } else {
         $this->render('login_form.tpl');
     }
 }
开发者ID:Galihom,项目名称:phpVMS,代码行数:13,代码来源:Login.php

示例4: index

 public function index()
 {
     require_once CORE_LIB_PATH . '/recaptcha/recaptchalib.php';
     if (Auth::LoggedIn()) {
         $this->render('login_already.tpl');
         return;
     }
     if (isset($_POST['submit'])) {
         $this->ProcessRegistration();
     } else {
         $this->ShowForm();
     }
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:13,代码来源:Registration.php

示例5: index

 public function index()
 {
     require_once CORE_LIB_PATH . '/recaptcha/recaptchalib.php';
     if ($this->post->submit) {
         if (Auth::LoggedIn() == false) {
             # Make sure they entered an email address
             if (trim($this->post->name) == '' || trim($this->post->email) == '') {
                 $this->set('message', 'You must enter a name and email!');
                 $this->render('core_error.tpl');
                 return;
             }
         }
         $resp = recaptcha_check_answer(Config::Get('RECAPTCHA_PRIVATE_KEY'), $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
         // Check the captcha thingy
         if (!$resp->is_valid) {
             $this->set('captcha_error', $resp->error);
             $this->set('message', 'You failed the captcha test!');
             $this->render('contact_form.tpl');
             return;
         }
         if ($this->post->subject == '' || trim($this->post->message) == '') {
             $this->set('message', 'You must enter a subject and message!');
             $this->render('core_error.tpl');
             return;
         }
         $subject = 'New message from ' . $this->post->name . ' - "' . $this->post->subject . '"';
         $message = DB::escape($this->post->message) . PHP_EOL . PHP_EOL;
         unset($_POST['recaptcha_challenge_field']);
         unset($_POST['recaptcha_response_field']);
         foreach ($_POST as $field => $value) {
             $message .= "-{$field} = {$value}" . PHP_EOL;
         }
         $message = nl2br($message);
         $message = utf8_encode($message);
         Util::SendEmail(ADMIN_EMAIL, $subject, $message);
         $this->render('contact_sent.tpl');
         return;
     }
     # Just a simple addition
     $rand1 = rand(1, 10);
     $rand2 = rand(1, 10);
     $this->set('rand1', $rand1);
     $this->set('rand2', $rand2);
     $tot = $rand1 + $rand2;
     //echo "total: $tot <br />";
     SessionManager::Set('captcha_sum', $tot);
     //echo 'output of $_SESSION: <br />';
     //print_r($_SESSION);
     $this->render('contact_form.tpl');
 }
开发者ID:Galihom,项目名称:phpVMS,代码行数:50,代码来源:Contact.php

示例6: index

 public function index()
 {
     //Google reCaptcha
     //updated to Google noCaptcha 1/15
     require_once CORE_LIB_PATH . '/recaptcha/recaptchalib.php';
     $this->set('sitekey', RECAPTCHA_PUBLIC_KEY);
     $this->set('lang', 'en');
     if ($this->post->submit) {
         if (Auth::LoggedIn() == false) {
             # Make sure they entered an email address
             if (trim($this->post->name) == '' || trim($this->post->email) == '') {
                 $this->set('message', 'You must enter a name and email!');
                 $this->render('core_error.tpl');
                 return;
             }
         }
         //Google reCaptcha
         //updated to Google noCaptcha 1/15
         $resp = null;
         $reCaptcha = new ReCaptcha(RECAPTCHA_PRIVATE_KEY);
         // Was there a reCAPTCHA response?
         if ($_POST["g-recaptcha-response"]) {
             $resp = $reCaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"]);
         }
         //check if reCaptcha response was valid
         if ($resp == null) {
             $this->set('captcha_error', 'reCaptcha Validation Error');
             $this->render('contact_form.tpl');
             return;
         }
         //end Google reCaptcha
         if ($this->post->subject == '' || trim($this->post->message) == '') {
             $this->set('message', 'You must enter a subject and message!');
             $this->render('core_error.tpl');
             return;
         }
         $subject = 'New message from ' . $this->post->name . ' - "' . $this->post->subject . '"';
         $message = DB::escape($this->post->message) . PHP_EOL . PHP_EOL;
         foreach ($_POST as $field => $value) {
             $message .= "-{$field} = {$value}" . PHP_EOL;
         }
         $message = nl2br($message);
         $message = utf8_encode($message);
         Util::SendEmail(ADMIN_EMAIL, $subject, $message);
         $this->render('contact_sent.tpl');
         return;
     }
     $this->render('contact_form.tpl');
 }
开发者ID:phpmods,项目名称:phpvms_5.5.x,代码行数:49,代码来源:Contact.php

示例7: post_module_load

function post_module_load()
{
    /* Misc tasks which need to get done */
    /* If the setting to auto-retired pilots is on, then do that
       and only check every 24 hours
       */
    if (Config::Get('USE_CRON') == false) {
        if (Config::Get('PILOT_AUTO_RETIRE') == true) {
            $within_timelimit = CronData::check_hoursdiff('find_retired_pilots', '24');
            if ($within_timelimit === false) {
                PilotData::findRetiredPilots();
                CronData::set_lastupdate('find_retired_pilots');
            }
        }
        if (Config::Get('CLOSE_BIDS_AFTER_EXPIRE') === false) {
            $within_timelimit = CronData::check_hoursdiff('check_expired_bids', '24');
            if ($within_timelimit === false) {
                SchedulesData::deleteExpiredBids();
                CronData::set_lastupdate('check_expired_bids');
            }
        }
        /* Expenses, make sure they're all populated */
        $within_timelimit = CronData::check_hoursdiff('populate_expenses', 18);
        if ($within_timelimit === false) {
            FinanceData::updateAllExpenses();
            CronData::set_lastupdate('populate_expenses');
        }
        /* And finally, clear expired sessions */
        Auth::clearExpiredSessions();
    }
    if (Config::Get('TWITTER_AIRLINE_ACCOUNT') != '') {
        $within_timelimit = CronData::check_hoursdiff('twitter_update', '3');
        if ($within_timelimit === false) {
            ActivityData::readTwitter();
            CronData::set_lastupdate('twitter_update');
        }
    }
    // @TODO: Clean ACARS records older than one month
    if (Config::Get('MAINTENANCE_MODE') == true && !Auth::LoggedIn() && !PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN)) {
        Template::Show('maintenance.tpl');
        die;
    }
    return true;
}
开发者ID:Galihom,项目名称:phpVMS,代码行数:44,代码来源:bootstrap.inc.php

示例8: index

 public function index()
 {
     if (!Auth::LoggedIn()) {
         $this->set('message', '<div id="error"><b>You must be logged in to access this feature!</b></div><br />');
         $this->show('frontpage_main');
         return;
     } else {
         $open = ExamsData::get_setting_info('2');
         if ($open->value == '0') {
             $message = ExamsData::get_setting_info('3');
             echo '<div id="error">' . $message->value . '</div>';
         } else {
             $pid = Auth::$userinfo->pilotid;
             $message = ExamsData::get_setting_info('4');
             $this->set('message', '<h4>' . $message->value . '</h4>');
             $this->set('exams', ExamsData::get_exams());
             $this->set('pilotmoney', Auth::$userinfo->totalpay);
             $this->show('exams/exam_list');
         }
     }
 }
开发者ID:web541,项目名称:phpVMS-ExamCenter,代码行数:21,代码来源:Exams.php

示例9: post_module_load

function post_module_load()
{
    /* Misc tasks which need to get done */
    /* If the setting to auto-retired pilots is on, then do that
    		and only check every 24 hours
    	 */
    if (Config::Get('USE_CRON') === true) {
        if (Config::Get('PILOT_AUTO_RETIRE') == true) {
            $within_timelimit = CronData::check_hoursdiff('find_retired_pilots', '24');
            if ($within_timelimit == false) {
                PilotData::findRetiredPilots();
                CronData::set_lastupdate('find_retired_pilots');
            }
        }
        if (Config::Get('CLOSE_BIDS_AFTER_EXPIRE') === false) {
            $within_timelimit = CronData::check_hoursdiff('check_expired_bids', '24');
            if ($within_timelimit == false) {
                SchedulesData::deleteExpiredBids();
                CronData::set_lastupdate('check_expired_bids');
            }
        }
        /* Expenses, make sure they're all populated */
        $within_timelimit = CronData::check_hoursdiff('populate_expenses', '18');
        if ($within_timelimit == false) {
            FinanceData::updateAllExpenses();
            CronData::set_lastupdate('populate_expenses');
        }
        /* And finally, clear expired sessions */
        Auth::clearExpiredSessions();
    }
    // @TODO: Clean ACARS records older than one month
    if (Config::Get('MAINTENANCE_MODE') == true && !Auth::LoggedIn() && !PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN)) {
        echo '<html><head><title>Down for maintenance - ' . SITE_NAME . '</title></head><body>';
        Debug::showCritical(Config::Get('MAINTENANCE_MESSAGE'), 'Down for maintenance');
        echo '</body></html>';
        die;
    }
    return true;
}
开发者ID:deanstalker,项目名称:phpVMS,代码行数:39,代码来源:bootstrap.inc.php

示例10: __call

 public function __call($name, $args)
 {
     // $name here is the filename, but we don't call it in directly
     //	for security reasons
     $page = DB::escape($name);
     $pageinfo = SiteData::GetPageDataByName($page);
     if ($pageinfo->public == 0 && Auth::LoggedIn() == false) {
         $this->render('pages_nopermission.tpl');
         return;
     }
     $content = SiteData::GetPageContent($page);
     if (!$content) {
         $this->render('pages_notfound.tpl');
     } else {
         // Do it this way, so then that this page/template
         //	can be customized on a skin-by-skin basis
         $this->title = $content->pagename;
         $this->set('pagename', $content->pagename);
         # Do entity encoding, compensate for a html_entity_decode() in the templates
         $this->set('content', htmlentities($content->content));
         $this->render('pages_content.tpl');
     }
 }
开发者ID:Galihom,项目名称:phpVMS,代码行数:23,代码来源:Pages.php

示例11:

		<td>
                    <?php 
if (isset($captcha_error)) {
    echo '<p class="error">' . $captcha_error . '</p>';
}
?>
                    <div class="g-recaptcha" data-sitekey="<?php 
echo $sitekey;
?>
"></div>
                    <script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl=<?php 
echo $lang;
?>
">
                    </script>
		</td>
	</tr>

    <tr>
		<td>
			<input type="hidden" name="loggedin" value="<?php 
echo Auth::LoggedIn() ? 'true' : 'false';
?>
" />
		</td>
		<td>
          <input type="submit" name="submit" value='Send Message'>
		</td>
    </tr>
  </table>
</form>
开发者ID:phpmods,项目名称:phpvms_5.5.x,代码行数:31,代码来源:contact_form.php

示例12: change_password_post

 protected function change_password_post()
 {
     if (!Auth::LoggedIn()) {
         $this->set('message', 'You must be logged in to access this feature!');
         $this->render('core_error.tpl');
         return;
     }
     // Verify
     if ($this->post->oldpassword == '') {
         $this->set('message', 'You must enter your current password');
         $this->render('core_error.tpl');
         return;
     }
     if ($this->post->password1 != $this->post->password2) {
         $this->set('message', 'Your passwords do not match');
         $this->render('core_error.tpl');
         return;
     }
     // Change
     $hash = md5($this->post->oldpassword . Auth::$userinfo->salt);
     if ($hash == Auth::$userinfo->password) {
         RegistrationData::ChangePassword(Auth::$pilotid, $_POST['password1']);
         $this->set('message', 'Your password has been reset');
     } else {
         $this->set('message', 'You entered an invalid password');
     }
     $this->render('core_success.tpl');
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:28,代码来源:Profile.php

示例13: define

 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @author Nabeel Shahzad
 * @copyright Copyright (c) 2008, Nabeel Shahzad
 * @link http://www.nsslive.net/codon
 * @license BSD License
 * @package codon_core
 */
/**
 * @author Nabeel Shahzad <www.phpvms.net>
 * @desc Admin panel home
 */
define('ADMIN_PANEL', true);
include '../core/codon.config.php';
if (!Auth::LoggedIn()) {
    Debug::showCritical('Please login first');
    die;
}
if (!PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) {
    Debug::showCritical('Unauthorized access');
    die;
}
$BaseTemplate = new TemplateSet();
$tplname = Config::Get('ADMIN_SKIN');
if ($tplname == '') {
    $tplname = 'layout';
}
//load the main skin
$settings_file = SITE_ROOT . '/admin/lib/' . $tplname . '/' . $tplname . '.php';
if (file_exists($settings_file)) {
开发者ID:deanstalker,项目名称:phpVMS,代码行数:31,代码来源:index.php

示例14: removebid

 public function removebid()
 {
     if (!Auth::LoggedIn()) {
         return;
     }
     SchedulesData::RemoveBid($this->post->id);
 }
开发者ID:web541,项目名称:FltbookSystem,代码行数:7,代码来源:Schedules.php

示例15: define

 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @author Nabeel Shahzad
 * @copyright Copyright (c) 2008, Nabeel Shahzad
 * @link http://www.nsslive.net/codon
 * @license BSD License
 * @package codon_core
 */
/**
 * @author Nabeel Shahzad <www.phpvms.net>
 * @desc Handles AJAX calls
 */
define('ADMIN_PANEL', true);
include '../core/codon.config.php';
error_reporting(E_ALL ^ E_NOTICE);
if (!Auth::LoggedIn() && !PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) {
    Debug::showCritical('Unauthorized access!');
    die;
}
$tplname = Config::Get('ADMIN_SKIN');
if ($tplname == '') {
    $tplname = 'layout';
}
$settings_file = SITE_ROOT . '/admin/lib/' . $tplname . '/' . $tplname . '.php';
if (file_exists($settings_file)) {
    include $settings_file;
}
Template::setTemplatePath(dirname(__FILE__) . '/templates');
Template::setSkinPath(SITE_ROOT . '/admin/lib/' . $tplname);
MainController::runAllActions();
# Force connection close
开发者ID:Galihom,项目名称:phpVMS,代码行数:31,代码来源:action.php


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