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


PHP Yum::module方法代码示例

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


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

示例1: beforeAction

 public function beforeAction($action)
 {
     if (Yum::module()->enableOnlineStatus && !Yii::app()->user->isGuest) {
         Yii::app()->user->data()->setLastAction();
     }
     return parent::beforeAction($action);
 }
开发者ID:bhaveshsoni,项目名称:yii-user-management,代码行数:7,代码来源:YumController.php

示例2: tableName

 public function tableName()
 {
     if (isset(Yum::module('profile')->profileCommentTable)) {
         return Yum::module('profile')->profileCommentTable;
     }
     return '{{profile_comment}}';
 }
开发者ID:bhaveshsoni,项目名称:yii-user-management,代码行数:7,代码来源:YumProfileComment.php

示例3: checkAccess

	public function checkAccess($operation, $params=array(), $allowCaching=true)
	{
		if(!Yum::hasModule('role') ||	Yum::module('role')->useYiiCheckAccess )
			return parent::checkAccess($operation, $params, $allowCaching);

		return $this->can($operation);	
	}
开发者ID:richardh68,项目名称:yii-user-management,代码行数:7,代码来源:YumWebUser.php

示例4: tableName

 public function tableName()
 {
     if (isset(Yum::module('profile')->privacySettingTable)) {
         return Yum::module('profile')->privacySettingTable;
     }
     return '{{privacysetting}}';
 }
开发者ID:bhaveshsoni,项目名称:yii-user-management,代码行数:7,代码来源:YumPrivacySetting.php

示例5: rules

	public function rules() 
	{
		$rules = parent::rules();

		/* FIXME: As soon as i grasp how i can dynamically add variables to a 
			 class in PHP, i will enable this code snippet for flexibility:

			 $profile = new YumProfile;
			 $profile_rules = $profile->rules();
			 foreach($profile_rules as $rule) 
			 if(isset($rule[0]) && is_string($rule[0]))
			 $this->${$rule[0]} = ''; 

			 $rules = array_merge($rules, $profile->rules());	 */

		$rules[] = array('username', 'required');
		$rules[] = array('password, verifyPassword', 'required');
		$rules[] = array('password', 'compare',
				'compareAttribute'=>'verifyPassword',
				'message' => Yum::t("Retype password is incorrect."));
		if(Yum::module('registration')->enableCaptcha)
			$rules[] = array('verifyCode', 'captcha',
					'allowEmpty'=>CCaptcha::checkRequirements()); 

		return $rules;
	}
开发者ID:neam,项目名称:yii-user-management,代码行数:26,代码来源:YumRegistrationForm.php

示例6: actionCreate

 public function actionCreate()
 {
     $this->layout = Yum::module()->adminLayout;
     $model = new YumPermission();
     $this->performAjaxValidation($model, 'permission-create-form');
     if (isset($_POST['YumPermission'])) {
         $model->attributes = $_POST['YumPermission'];
         if ($model->validate()) {
             if ($_POST['YumPermission']['type'] == 'user') {
                 $model->subordinate = $_POST['YumPermission']['subordinate_id'];
                 $model->principal = $_POST['YumPermission']['principal_id'];
             } else {
                 if ($_POST['YumPermission']['type'] == 'role') {
                     $model->subordinate_role = $_POST['YumPermission']['subordinate_id'];
                     $model->principal_role = $_POST['YumPermission']['principal_id'];
                 }
             }
             if ($model->save()) {
                 $this->redirect(array('admin'));
             }
             return;
         }
     }
     $model->type = 'user';
     // preselect 'user'
     $this->render('create', array('model' => $model));
 }
开发者ID:Canyian,项目名称:yii-user-management-facebook,代码行数:27,代码来源:YumPermissionController.php

示例7: actionEditAvatar

 public function actionEditAvatar()
 {
     $model = YumUser::model()->findByPk(Yii::app()->user->id);
     if (isset($_POST['YumUser'])) {
         $model->attributes = $_POST['YumUser'];
         $model->setScenario('avatarUpload');
         if (Yum::module('avatar')->avatarMaxWidth != 0) {
             $model->setScenario('avatarSizeCheck');
         }
         $model->avatar = CUploadedFile::getInstanceByName('YumUser[avatar]');
         if ($model->validate()) {
             if ($model->avatar instanceof CUploadedFile) {
                 // Prepend the id of the user to avoid filename conflicts
                 $filename = Yum::module('avatar')->avatarPath . '/' . $model->id . '_' . $_FILES['YumUser']['name']['avatar'];
                 $model->avatar->saveAs($filename);
                 $model->avatar = $filename;
                 if ($model->save()) {
                     Yum::setFlash(Yum::t('The image was uploaded successfully'));
                     Yum::log(Yum::t('User {username} uploaded avatar image {filename}', array('{username}' => $model->username, '{filename}' => $model->avatar)));
                     $this->redirect(array('//profile/profile/view'));
                 }
             }
         }
     }
     $this->render('edit_avatar', array('model' => $model));
 }
开发者ID:Canyian,项目名称:yii-user-management-facebook,代码行数:26,代码来源:YumAvatarController.php

示例8: tableName

 public function tableName()
 {
     if (isset(Yum::module('profile')->profileVisitTable)) {
         return Yum::module('profile')->profileVisitTable;
     }
     return '{{profile_visit}}';
 }
开发者ID:bhaveshsoni,项目名称:yii-user-management,代码行数:7,代码来源:YumProfileVisit.php

示例9: tableName

 public function tableName()
 {
     if (isset(Yum::module()->translationTable)) {
         return Yum::module()->translationTable;
     } else {
         return '{{translation}}';
     }
 }
开发者ID:bhaveshsoni,项目名称:yii-user-management,代码行数:8,代码来源:YumTranslation.php

示例10: behaviors

 /**
  * Adds the CAdvancedArBehavior and, if enabled, the LoggableBehavior to
  * every YUM Active Record model
  * @return array
  */
 public function behaviors()
 {
     $behaviors = array('CAdvancedArBehavior');
     if (Yum::module()->enableAuditTrail) {
         $behaviors = array_merge($behaviors, array('LoggableBehavior' => 'application.modules.auditTrail.behaviors.LoggableBehavior'));
     }
     return $behaviors;
 }
开发者ID:snapfrozen,项目名称:boxomatic,代码行数:13,代码来源:YumActiveRecord.php

示例11: rules

 public function rules()
 {
     $rules = array(array('login_or_email', 'required'), array('login_or_email', 'checkexists'));
     if (Yum::module('registration')->validEmailPattern) {
         $rules[] = array('login_or_email', 'match', 'pattern' => Yum::module('registration')->validEmailPattern, 'message' => Yum::t('Incorrect symbols. (A-z0-9)'));
     }
     return $rules;
 }
开发者ID:Canyian,项目名称:yii-user-management-facebook,代码行数:8,代码来源:YumPasswordRecoveryForm.php

示例12: createRandomPassword

	public function createRandomPassword() {

		$lowercase = Yum::module()->passwordRequirements['minLowerCase'];
		$uppercase = Yum::module()->passwordRequirements['minUpperCase'];
		$minnumbers = Yum::module()->passwordRequirements['minDigits'];
		$max = Yum::module()->passwordRequirements['maxLen'];

		$chars = "abcdefghijkmnopqrstuvwxyz";
		$numbers = "1023456789";
		srand((double) microtime() * 1000000);
		$i = 0;
		$current_lc = 0;
		$current_uc = 0;
		$current_dd = 0;
		$password = '';
		while ($i <= $max) {
			if ($current_lc < $lowercase) {
				$charnum = rand() % 22;
				$tmpchar = substr($chars, $charnum, 1);
				$password = $password . $tmpchar;
				$i++;
			}

			if ($current_uc < $uppercase) {
				$charnum = rand() % 22;
				$tmpchar = substr($chars, $charnum, 1);
				$password = $password . strtoupper($tmpchar);
				$i++;
			}

			if ($current_dd < $minnumbers) {
				$charnum = rand() % 9;
				$tmpchar = substr($numbers, $charnum, 1);
				$password = $password . $tmpchar;
				$i++;
			}

			if ($current_lc == $lowercase && $current_uc == $uppercase && $current_dd == $numbers && $i < $max) {
				$charnum = rand() % 22;
				$tmpchar = substr($chars, $charnum, 1);
				$password = $password . $tmpchar;
				$i++;
				if ($i < $max) {
					$charnum = rand() % 9;
					$tmpchar = substr($numbers, $charnum, 1);
					$password = $password . $tmpchar;
					$i++;
				}
				if ($i < $max) {
					$charnum = rand() % 22;
					$tmpchar = substr($chars, $charnum, 1);
					$password = $password . strtoupper($tmpchar);
					$i++;
				}
			}
		}
		return $password;
	}
开发者ID:neam,项目名称:yii-user-management,代码行数:58,代码来源:YumUserChangePassword.php

示例13: beforeAction

 public function beforeAction($event)
 {
     if (Yii::app()->user->isAdmin()) {
         $this->layout = Yum::module('usergroup')->adminLayout;
     } else {
         $this->layout = Yum::module('usergroup')->layout;
     }
     return parent::beforeAction($event);
 }
开发者ID:usmansaleem10,项目名称:youthpowered,代码行数:9,代码来源:YumUsergroupController.php

示例14: tableName

	public function tableName() {
            if (isset(Yum::module()->textSettingsTable))
                $this->_tableName = Yum::module()->textSettingsTable;
            elseif (isset(Yii::app()->modules['user']['textSettingsTable']))
                $this->_tableName = Yii::app()->modules['user']['textSettingsTable'];
            else
                $this->_tableName = '{{yumtextsettings}}'; // fallback if nothing is set
            return Yum::resolveTableName($this->_tableName, $this->getDbConnection());
	}
开发者ID:richardh68,项目名称:yii-user-management,代码行数:9,代码来源:YumTextSettings.php

示例15: actionAdmin

 public function actionAdmin()
 {
     $this->layout = Yum::module()->adminLayout;
     $model = new YumAction('search');
     $model->unsetAttributes();
     if (isset($_GET['YumAction'])) {
         $model->attributes = $_GET['YumAction'];
     }
     $this->render('admin', array('model' => $model));
 }
开发者ID:Canyian,项目名称:yii-user-management-facebook,代码行数:10,代码来源:YumActionController.php


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