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


PHP SwpmUtils::is_subscription_expired方法代码示例

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


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

示例1: check_constraints

 private function check_constraints()
 {
     if (empty($this->userData)) {
         return false;
     }
     $enable_expired_login = SwpmSettings::get_instance()->get_value('enable-expired-account-login', '');
     $can_login = true;
     if ($this->userData->account_state == 'inactive') {
         $this->lastStatusMsg = SwpmUtils::_('Account is inactive.');
         $can_login = false;
     } else {
         if ($this->userData->account_state == 'pending') {
             $this->lastStatusMsg = SwpmUtils::_('Account is pending.');
             $can_login = false;
         } else {
             if ($this->userData->account_state == 'expired' && empty($enable_expired_login)) {
                 $this->lastStatusMsg = SwpmUtils::_('Account has expired.');
                 $can_login = false;
             }
         }
     }
     if (!$can_login) {
         $this->isLoggedIn = false;
         $this->userData = null;
         return false;
     }
     if (SwpmUtils::is_subscription_expired($this->userData)) {
         if ($this->userData->account_state == 'active') {
             global $wpdb;
             $wpdb->update($wpdb->prefix . 'swpm_members_tbl', array('account_state' => 'expired'), array('member_id' => $this->userData->member_id), array('%s'), array('%d'));
         }
         if (empty($enable_expired_login)) {
             $this->lastStatusMsg = SwpmUtils::_('Account has expired.');
             $this->isLoggedIn = false;
             $this->userData = null;
             return false;
         }
     }
     $this->permitted = SwpmPermission::get_instance($this->userData->membership_level);
     $this->lastStatusMsg = SwpmUtils::_("You are logged in as:") . $this->userData->user_name;
     $this->isLoggedIn = true;
     return true;
 }
开发者ID:AndroidScriptAS,项目名称:bismarck_smv,代码行数:43,代码来源:class.swpm-auth.php

示例2: check_constraints

 private function check_constraints()
 {
     if (empty($this->userData)) {
         return false;
     }
     global $wpdb;
     $enable_expired_login = SwpmSettings::get_instance()->get_value('enable-expired-account-login', '');
     //Update the last accessed date and IP address for this login attempt. $wpdb->update(table, data, where, format, where format)
     $last_accessed_date = current_time('mysql');
     $last_accessed_ip = SwpmUtils::get_user_ip_address();
     $wpdb->update($wpdb->prefix . 'swpm_members_tbl', array('last_accessed' => $last_accessed_date, 'last_accessed_from_ip' => $last_accessed_ip), array('member_id' => $this->userData->member_id), array('%s', '%s'), array('%d'));
     //Check the member's account status.
     $can_login = true;
     if ($this->userData->account_state == 'inactive' && empty($enable_expired_login)) {
         $this->lastStatusMsg = SwpmUtils::_('Account is inactive.');
         $can_login = false;
     } else {
         if ($this->userData->account_state == 'expired' && empty($enable_expired_login)) {
             $this->lastStatusMsg = SwpmUtils::_('Account has expired.');
             $can_login = false;
         } else {
             if ($this->userData->account_state == 'pending') {
                 $this->lastStatusMsg = SwpmUtils::_('Account is pending.');
                 $can_login = false;
             }
         }
     }
     if (!$can_login) {
         $this->isLoggedIn = false;
         $this->userData = null;
         return false;
     }
     if (SwpmUtils::is_subscription_expired($this->userData)) {
         if ($this->userData->account_state == 'active') {
             $wpdb->update($wpdb->prefix . 'swpm_members_tbl', array('account_state' => 'expired'), array('member_id' => $this->userData->member_id), array('%s'), array('%d'));
         }
         if (empty($enable_expired_login)) {
             $this->lastStatusMsg = SwpmUtils::_('Account has expired.');
             $this->isLoggedIn = false;
             $this->userData = null;
             return false;
         }
     }
     $this->permitted = SwpmPermission::get_instance($this->userData->membership_level);
     $this->lastStatusMsg = SwpmUtils::_("You are logged in as:") . $this->userData->user_name;
     $this->isLoggedIn = true;
     return true;
 }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:48,代码来源:class.swpm-auth.php


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