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


PHP UserHelper::getName方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     $this->username = UserHelper::getName();
     $this->uploaddir = AVATAR_DIR;
     $this->uploadfile = $this->uploaddir . $this->username . '.jpg';
     $this->avatarfile = $this->uploaddir . $this->username . '-avatar.jpg';
     $this->minifile = $this->uploaddir . $this->username . '-mini.jpg';
     $this->target_width = $this->target_height = 160;
     $this->mini_width = $this->mini_height = 40;
     $this->jpeg_quality = 100;
 }
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:11,代码来源:AvatarController.php

示例2: create

 public function create()
 {
     try {
         $this->db = fORMDatabase::retrieve();
         $this->db->query('BEGIN');
         $profile = new Profile();
         $profile->setLoginName(UserHelper::getName());
         $profile->setDisplayName(UserHelper::getDisplayName());
         $profile->setStartYear(fRequest::get('start_year'));
         $profile->setClassNumber(fRequest::get('class_number'));
         $profile->setStudentNumber(trim(fRequest::get('student_number')));
         if (strlen($profile->getStudentNumber()) && !preg_match('/^\\d{10}$/', $profile->getStudentNumber())) {
             throw new fValidationException('学号必须为10位数字');
         }
         $profile->setBirthday(trim(fRequest::get('birthday')));
         $profile->setGender(fRequest::get('gender'));
         //$profile->setLocation(trim(fRequest::get('location')));
         $province = trim(fRequest::get('province'));
         $city = trim(fRequest::get('city'));
         $profile->setLocation(self::formatLocation($province, $city));
         $profile->setPostNumber(trim(fRequest::get('post_number')));
         $profile->setSubscription(trim(fRequest::get('subscription')));
         $profile->setAdvices(trim(fRequest::get('advices')));
         $profile->setPrivacyControl(trim(fRequest::get('privacy', 'int', 0)));
         $profile->setField(trim(fRequest::get('field')));
         $profile->setInstitute(trim(fRequest::get('institute')));
         $profile->setPosition(trim(fRequest::get('position')));
         $profile->setMajor(trim(fRequest::get('major')));
         $profile->setMentor(trim(fRequest::get('mentor')));
         $profile->setCreatedAt(Util::currentTime());
         $profile->store();
         foreach ($this->contact_types as $type) {
             if (strlen(trim(fRequest::get($type)))) {
                 $contact = new Contact();
                 $contact->setProfileId($profile->getId());
                 $contact->setType($type);
                 $contact->setContent(trim(fRequest::get($type)));
                 $contact->setCreatedAt(Util::currentTime());
                 $contact->store();
             }
         }
         $this->db->query('COMMIT');
         Activity::fireNewProfile();
         $this->ajaxReturn(array('result' => 'success', 'profile_id' => $profile->getId()));
     } catch (fException $e) {
         if (isset($this->db)) {
             $this->db->query('ROLLBACK');
         }
         $this->ajaxReturn(array('result' => 'failure', 'message' => $e->getMessage()));
     }
 }
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:51,代码来源:ProfileController.php

示例3: isEditor

 public static function isEditor()
 {
     return strstr(EDITOR_IDS, '|' . UserHelper::getName() . '|') !== false;
 }
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:4,代码来源:UserHelper.php


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