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


PHP GO::ignoreAclPermissions方法代码示例

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


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

示例1: setIgnoreAclPermissions

 /**
  * If you set this to true then all acl's will allow all actions. Useful
  * for maintenance scripts.
  *
  * It returns the old value.
  *
  * @param string $ignore
  * @return boolean Old value
  */
 public static function setIgnoreAclPermissions($ignore = true)
 {
     \GO::debug("setIgnoreAclPermissions(" . var_export($ignore, true) . ')');
     $oldValue = \GO::$ignoreAclPermissions;
     \GO::$ignoreAclPermissions = $ignore;
     return $oldValue;
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:16,代码来源:GO.php

示例2: actionResetPassword

 public function actionResetPassword()
 {
     if (empty($_GET['email'])) {
         throw new \Exception(\GO::t("noemail", "site"));
     }
     $user = \GO\Base\Model\User::model()->findSingleByAttribute('email', $_GET['email']);
     if (!$user) {
         throw new \Exception(\GO::t("invaliduser", "site"));
     }
     if (isset($_GET['usertoken']) && $_GET['usertoken'] == $user->getSecurityToken()) {
         if (\GO\Base\Util\Http::isPostRequest()) {
             $user->password = $_POST['User']['password'];
             $user->passwordConfirm = $_POST['User']['passwordConfirm'];
             \GO::$ignoreAclPermissions = true;
             if ($user->validate() && $user->save()) {
                 \Site::notifier()->setMessage('success', \GO::t('resetPasswordSuccess', 'site'));
             }
         }
     } else {
         \Site::notifier()->setMessage('error', \GO::t("invalidusertoken", "site"));
     }
     $user->password = null;
     echo $this->render('resetPassword', array('user' => $user));
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:24,代码来源:AccountController.php

示例3: array

<?php

echo "Converting existing categories from user to calendar\n";
//require_once('../../../../GO.php');
\GO::$ignoreAclPermissions = true;
$oldCategories = array();
$stmt = \GO\Calendar\Model\Category::model()->find();
while ($category = $stmt->fetch()) {
    if ($category->calendar_id != 0) {
        $oldCategories[] = $category->id;
        echo "Category {$category->name}\n";
        $calStmt = \GO\Calendar\Model\Calendar::model()->findByAttribute('user_id', $category->calendar_id);
        while ($calendar = $calStmt->fetch()) {
            try {
                // Create the new categories for each calendar
                $newCategory = new \GO\Calendar\Model\Category();
                $newCategory->name = $category->name;
                $newCategory->color = $category->color;
                $newCategory->calendar_id = $calendar->id;
                $newCategory->save();
                // Get all events that have the old category and change the category to the new one.
                $eventStmt = \GO\Calendar\Model\Event::model()->findByAttributes(array('calendar_id' => $calendar->id, 'category_id' => $category->id));
                while ($event = $eventStmt->fetch()) {
                    //echo "Update event $event->name\n";
                    $event->category_id = $newCategory->id;
                    $event->save();
                }
            } catch (\Exception $e) {
                echo $e->getMessage() . "\n";
            }
        }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:31,代码来源:1_convert_categories.php

示例4: isset

 function process_form()
 {
     \GO::$ignoreAclPermissions = true;
     $this->check_required();
     if (!isset($_POST['salutation'])) {
         $_POST['salutation'] = isset($_POST['sex']) ? \GO::t('default_salutation_' . $_POST['sex']) : \GO::t('default_salutation_unknown');
     }
     //user registation
     //		if(!empty($_POST['username'])){
     //			$credentials = array ('username','first_name','middle_name','last_name','title','initials','sex','email',
     //			'home_phone','fax','cellular','address','address_no',
     //			'zip','city','state','country','company','department','function','work_phone',
     //			'work_fax');
     //
     //			if($_POST['password1'] != $_POST['password2'])
     //			{
     //				throw new Exception(\GO::t('error_match_pass','users'));
     //			}
     //
     //			foreach($credentials as $key)
     //			{
     //				if(!empty($_REQUEST[$key]))
     //				{
     //					$userCredentials[$key] = $_REQUEST[$key];
     //				}
     //			}
     //			$userCredentials['password']=$_POST['password1'];
     //
     //			$userModel = new \GO\Base\Model\User();
     //			$userModel->setAttributes($userCredentials);
     //			$userModel->save();
     //			foreach($this->user_groups as $groupId) {
     //				$currentGroupModel = \GO\Base\Model\Group::model()->findByPk($groupId);
     //				if($groupId>0 && $groupId!=\GO::config()->group_everyone && !$currentGroupModel->hasUser($userModel->id)) {
     //					$currentGroupModel->addUser($userModel->id);
     //				}
     //			}
     //			foreach($this->visible_user_groups as $groupId) {
     //				$userAclModel = \GO\Base\Model\Acl::model()->findByPk($userModel->acl_id);
     //				if($groupId>0 && !empty($userAclModel) && $userAclModel->hasGroup($groupId)) {
     //					$userAclModel->addGroup($groupId);
     //				}
     //			}
     //
     //			\GO::session()->login($userCredentials['username'], $userCredentials['password']);
     //		}
     if (!empty($_POST['email']) && !\GO\Base\Util\String::validate_email($_POST['email'])) {
         throw new Exception(\GO::t('invalidEmailError'));
     }
     if (!empty($_REQUEST['addressbook'])) {
         //			require($GO_LANGUAGE->get_language_file('addressbook'));
         //			require_once($GO_MODULES->modules['addressbook']['class_path'].'addressbook.class.inc.php');
         //			$ab = new addressbook();
         //
         //			$addressbook = $ab->get_addressbook_by_name($_REQUEST['addressbook']);
         $addressbookModel = \GO\Addressbook\Model\Addressbook::model()->findSingleByAttribute('name', $_REQUEST['addressbook']);
         if (!$addressbookModel) {
             throw new Exception('Addressbook not found!');
         }
         $credentials = array('first_name', 'middle_name', 'last_name', 'title', 'initials', 'sex', 'email', 'email2', 'email3', 'home_phone', 'fax', 'cellular', 'comment', 'address', 'address_no', 'zip', 'city', 'state', 'country', 'company', 'department', 'function', 'work_phone', 'work_fax', 'salutation', 'url_linkedin', 'url_facebook', 'url_twitter', 'skype_name');
         foreach ($credentials as $key) {
             if (!empty($_REQUEST[$key])) {
                 $contactCredentials[$key] = $_REQUEST[$key];
             }
         }
         if (isset($contactCredentials['comment']) && is_array($contactCredentials['comment'])) {
             $comments = '';
             foreach ($contactCredentials['comment'] as $key => $value) {
                 if ($value == 'date') {
                     $value = date($_SESSION['GO_SESSION']['date_format'] . ' ' . $_SESSION['GO_SESSION']['time_format']);
                 }
                 if (!empty($value)) {
                     $comments .= trim($key) . ":\n" . trim($value) . "\n\n";
                 }
             }
             $contactCredentials['comment'] = $comments;
         }
         if ($this->no_urls && isset($contactCredentials['comment']) && stripos($contactCredentials['comment'], 'http')) {
             throw new Exception('Sorry, but to prevent spamming we don\'t allow URL\'s in the message');
         }
         $contactCredentials['addressbook_id'] = $addressbookModel->id;
         $contactCredentials['email_allowed'] = isset($_POST['email_allowed']) ? '1' : '0';
         if (!empty($contactCredentials['company']) && empty($contactCredentials['company_id'])) {
             $companyModel = \GO\Addressbook\Model\Company::model()->findSingleByAttributes(array('name' => $contactCredentials['company'], 'addressbook_id' => $contactCredentials['addressbook_id']));
             if (empty($companyModel)) {
                 $companyModel = new \GO\Addressbook\Model\Company();
                 $companyModel->addressbook_id = $contactCredentials['addressbook_id'];
                 $companyModel->name = $contactCredentials['company'];
                 // bedrijfsnaam
                 $companyModel->user_id = \GO::user()->id;
                 $companyModel->save();
                 $contactCredentials['company_id'] = $companyModel->id;
             }
         }
         if (isset($_POST['birthday'])) {
             try {
                 $contactCredentials['birthday'] = \GO\Base\Util\Date::to_db_date($_POST['birthday'], false);
             } catch (Exception $e) {
                 throw new Exception(\GO::t('birthdayFormatMustBe') . ': ' . $_SESSION['GO_SESSION']['date_format'] . '.');
             }
//.........这里部分代码省略.........
开发者ID:ajaboa,项目名称:crmpuan,代码行数:101,代码来源:formprocessor.class.inc.php

示例5: actionSyncContacts

 protected function actionSyncContacts($params)
 {
     \GO::$ignoreAclPermissions = true;
     //allow this script access to all
     \GO::$disableModelCache = true;
     //for less memory usage
     ini_set('max_execution_time', '300');
     $ab = \GO\Addressbook\Model\Addressbook::model()->findSingleByAttribute('users', '1');
     //\GO::t('users','base'));
     if (!$ab) {
         $ab = new \GO\Addressbook\Model\Addressbook();
         $ab->name = \GO::t('users');
         $ab->users = true;
         $ab->save();
     }
     $stmt = User::model()->find();
     while ($user = $stmt->fetch()) {
         $contact = $user->contact();
         if (!$contact) {
             \GO::output("Creating contact for " . $user->username);
             $contact = new \GO\Addressbook\Model\Contact();
             $contact->go_user_id = $user->id;
             $contact->addressbook_id = $ab->id;
         } else {
             \GO::output("Updating contact for " . $user->username);
         }
         $attr = $user->getAttributes();
         unset($attr['id']);
         $contact->setAttributes($attr);
         $contact->save();
     }
     \GO::output("Done!");
     //return array('success' => true);
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:34,代码来源:UserController.php


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