• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP UsersPeer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: executeIndex

 /**
  * Executes index action
  *
  */
 public function executeIndex()
 {
     $u_id = sfContext::getInstance()->getUser()->getAttribute('subscriber_id', '-1', 'subscriber');
     if ($u_id <= 0) {
         $this->subscribe = null;
         if ($this->getRequest()->getMethod() == sfRequest::POST) {
             try {
                 $newUser = $this->getRequestParameter('email');
                 $this->subscribe = 'Thanks, we will contact you shortly at the email address you have provided';
                 /*$connection = new Swift_Connection_SMTP('smtp.gmail.com', 465, Swift_Connection_SMTP::ENC_SSL);
                           $connection->setUsername('[email protected]');
                           $connection->setPassword('bRb061626');
                 
                           $mailer = new Swift($connection);
                           $message = new Swift_Message('USER REQUEST-'.$email);
                 
                           // Send
                           $mailer->send($message, '[email protected]', '[email protected]');
                           $mailer->disconnect();
                         */
                 $email = new CycleBrainEmail();
                 $email->sendEmail('[email protected]', '[email protected]', 'BETA USER', $newUser);
             } catch (Exception $e) {
                 echo 'MainActions:Index Caught exception: ', $e->getMessage(), "\n";
             }
         }
     } else {
         $this->user = UsersPeer::retrieveByPK($u_id);
     }
 }
开发者ID:broschb,项目名称:cyclebrain,代码行数:34,代码来源:actions.class.php


示例2: getEmailEventAccounts

 /**
  * Get the email accounts of the current workspace
  *     
  * return array
  */
 public function getEmailEventAccounts()
 {
     try {
         $criteria = new \Criteria("workflow");
         $criteria->clearSelectColumns();
         $criteria->addSelectColumn(\UsersPeer::USR_UID);
         $criteria->addSelectColumn(\UsersPeer::USR_EMAIL);
         $criteria->addAsColumn('UID', 'USR_UID');
         $criteria->addAsColumn('EMAIL', 'USR_EMAIL');
         $criteria->add(\UsersPeer::USR_STATUS, "ACTIVE");
         $result = \UsersPeer::doSelectRS($criteria);
         $result->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
         $result->next();
         $accountsArray = array();
         while ($aRow = $result->getRow()) {
             if (($aRow['USR_EMAIL'] != null) || ($aRow['USR_EMAIL'] != "")) {
                 $accountsArray[] = array_change_key_case($aRow, CASE_LOWER);
             } 
             $result->next();
         }
         return $accountsArray;
     } catch (\Exception $e) {
         throw $e;
     }
 }
开发者ID:nhenderson,项目名称:processmaker,代码行数:30,代码来源:EmailEvent.php


示例3: init

 public function init()
 {
     parent::init();
     // Verify we're on the correct database
     //print_r(coreConfig::get('database_connection'));exit;
     $connectionInfo = coreConfig::get('database_connection');
     $this->verbose("Using database: %s", $connectionInfo['database']);
     $username = trim($this->getOption('u'));
     $raw_password = trim($this->getOption('p'));
     if (empty($username) || empty($raw_password)) {
         $this->throwError('Username or password is empty.');
     }
     $userid = UsersPeer::getUserId($username);
     if (false === $userid) {
         $this->throwError('User named "%s" not found.', $username);
     }
     $this->verbose("Userid: %s", $userid);
     $this->verbose("Set password to: %s", $raw_password);
     // update user record
     if (false === UsersPeer::updateUser($userid, array('raw_password' => $raw_password))) {
         $this->throwError('Could not update user "%s" (userid %s)', $username, $userid);
     }
     // only with linked PunBB forum
     if ($this->args->flag('forum')) {
         if (coreConfig::get('app_path_to_punbb') !== null) {
             PunBBUsersPeer::setPassword($username, $raw_password);
         } else {
             $this->throwError('Forum password: "app_path_to_punbb" is not defined in environment "%s"', CORE_ENVIRONMENT);
         }
     }
     $this->verbose('Success!');
 }
开发者ID:krisodb,项目名称:RevTK,代码行数:32,代码来源:setpassword.php


示例4: executeShow

 public function executeShow()
 {
     $this->users = UsersPeer::retrieveByPk($this->getRequestParameter('id'));
     $c = new Criteria();
     $c->add(RolePeer::ID, $this->users->getRoleId());
     $this->roles = RolePeer::doSelect($c);
     $this->forward404Unless($this->users);
 }
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:8,代码来源:actions.class.php


示例5: createUser

 private function createUser($username, $raw_password)
 {
     $userinfo = array('username' => $username, 'password' => coreContext::getInstance()->getUser()->getSaltyHashedPassword($raw_password), 'userlevel' => $this->getOption('level', UsersPeer::USERLEVEL_USER), 'email' => trim($this->getOption('email', 'created@localhost')), 'location' => trim($this->getOption('location', 'localhost')));
     //die(print_r($userinfo, true));
     if (false === UsersPeer::createUser($userinfo)) {
         $this->throwError('Could not create user.');
     }
 }
开发者ID:nikitakit,项目名称:RevTK,代码行数:8,代码来源:createUser.php


示例6: updateUser

 /**
  * Updates any column data for given user id.
  *
  * 'raw_password' will be hashed as required and stored into 'password' column.
  * 
  * @param int   $userid
  * @param array $data 
  * @return boolean
  */
 private function updateUser($userid, $data)
 {
     if (isset($data['raw_password'])) {
         $data['password'] = coreContext::getInstance()->getUser()->getSaltyHashedPassword($data['raw_password']);
         unset($data['raw_password']);
     }
     if (false === UsersPeer::updateUser($userid, $data)) {
         $this->throwError('Could not update user id %s', $userid);
     }
     return true;
 }
开发者ID:nikitakit,项目名称:RevTK,代码行数:20,代码来源:setpassword.php


示例7: executeIndex

 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $uid = $this->getRequestParameter('uid');
     $conf = $this->getRequestParameter('conf');
     $c = new Criteria();
     $c->add(UsersPeer::USER_ID, $uid);
     $user = UsersPeer::doSelectOne($c);
     if (sha1($user->getSalt() . $user->getUsername()) == $conf) {
         $this->goodConf = true;
         $user->setActive('Y');
         $user->save();
     } else {
         $this->goodConf = false;
     }
 }
开发者ID:broschb,项目名称:cyclebrain,代码行数:20,代码来源:actions.class.php


示例8: executeLogin

 public function executeLogin()
 {
     $c = new Criteria();
     $c->add(UsersPeer::USER_NAME, $this->getRequestParameter('login'));
     $c->add(UsersPeer::USER_PWD, $this->getRequestParameter('password'));
     $user_record = UsersPeer::doSelectOne($c);
     if ($user_record) {
         $this->getUser()->setAuthenticated(true);
         $c = new Criteria();
         $c->add(RolePeer::ID, $user_record->getRoleId());
         $user_role = RolePeer::doSelectOne($c);
         $this->getUser()->addCredential($user_role->getRoleName());
         return $this->redirect('users');
     } else {
         $this->getRequest()->setError('login', 'incorrect entry');
         return $this->forward('security', 'index');
     }
 }
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:18,代码来源:actions.class.php


示例9: executeLogin

 /**
  * Sign In form.
  * 
  * @return 
  */
 public function executeLogin($request)
 {
     if ($request->getMethod() != coreRequest::POST) {
         // get the referer option from redirectToLogin()
         $referer = $this->getUser()->getAttribute('login_referer', '');
         // get other options from redirectToLogin()
         $username = $this->getUser()->getAttribute('login_username', '');
         // clear redirectToLogin() options
         $this->getUser()->getAttributeHolder()->remove('login_referer');
         $this->getUser()->getAttributeHolder()->remove('login_username');
         $this->getRequest()->setParameter('referer', empty($referer) ? '@homepage' : $referer);
         $this->getRequest()->setParameter('username', $username);
         // AUTO FILL FORM (DEVELOPMENT ONLY!)
         if (CORE_ENVIRONMENT === 'dev') {
             $request->getParameterHolder()->add(array('username' => 'guest', 'password' => ''));
         }
     } else {
         $validator = new coreValidator($this->getActionName());
         if ($validator->validate($request->getParameterHolder()->getAll())) {
             $username = trim($request->getParameter('username'));
             $raw_password = trim($request->getParameter('password'));
             $rememberme = $request->hasParameter('rememberme');
             // check that user exists and password matches
             $user = UsersPeer::getUser($username);
             if (!$user || $this->getUser()->getSaltyHashedPassword($raw_password) != $user['password']) {
                 $request->setError('login_invalid', "Invalid username and/or password.");
                 return;
             }
             // sign in user
             $this->getUser()->signIn($user);
             // optionally, create the remember me cookie
             if ($rememberme) {
                 $this->getUser()->setRememberMeCookie($user['username'], $this->getUser()->getSaltyHashedPassword($raw_password));
             }
             // authenticate user on the community forums
             if (coreContext::getInstance()->getConfiguration()->getEnvironment() !== 'staging' && coreConfig::get('app_path_to_punbb') !== null) {
                 PunBBUsersPeer::signIn($username, $raw_password, $rememberme);
             }
             // succesfully signed in
             return $this->redirect($this->getRequestParameter('referer', '@homepage'));
         }
     }
 }
开发者ID:nikitakit,项目名称:RevTK,代码行数:48,代码来源:actions.php


示例10: executeIndex

 public function executeIndex($request)
 {
     $username = $request->getParameter('username');
     if (!$username) {
         if ($this->getUser()->isAuthenticated()) {
             $username = $this->getUser()->getUserName();
         } else {
             // if unauthenticated user checks his (bookmarked?) profile, go to login and back
             $url = $this->getController()->genUrl('profile/index', true);
             $this->getUser()->redirectToLogin(array('referer' => $url));
         }
     }
     if ($user = UsersPeer::getUser($username)) {
         $this->user = $user;
         $this->self_account = $user['username'] == $this->getUser()->getUserName();
         $this->kanji_count = ReviewsPeer::getReviewedFlashcardCount($user['userid']);
         $this->total_reviews = ReviewsPeer::getTotalReviews($user['userid']);
         $this->forum_uid = coreConfig::get('app_path_to_punbb') !== null ? PunBBUsersPeer::getInstance()->getForumUID($username) : false;
         return coreView::SUCCESS;
     }
     return coreView::ERROR;
 }
开发者ID:nikitakit,项目名称:RevTK,代码行数:22,代码来源:actions.php


示例11: adhocAssignUsersk

 function adhocAssignUsersk($params)
 {
     G::LoadClass('groups');
     G::LoadClass('tasks');
     $oTasks = new Tasks();
     $aAux = $oTasks->getGroupsOfTask($_SESSION['TASK'], 2);
     $aAdhocUsers = array();
     $oGroups = new Groups();
     foreach ($aAux as $aGroup) {
         $aUsers = $oGroups->getUsersOfGroup($aGroup['GRP_UID']);
         foreach ($aUsers as $aUser) {
             if ($aUser['USR_UID'] != $_SESSION['USER_LOGGED']) {
                 $aAdhocUsers[] = $aUser['USR_UID'];
             }
         }
     }
     $aAux = $oTasks->getUsersOfTask($_SESSION['TASK'], 2);
     foreach ($aAux as $aUser) {
         if ($aUser['USR_UID'] != $_SESSION['USER_LOGGED']) {
             $aAdhocUsers[] = $aUser['USR_UID'];
         }
     }
     require_once 'classes/model/Users.php';
     $oCriteria = new Criteria('workflow');
     $oCriteria->addSelectColumn(UsersPeer::USR_UID);
     $oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
     $oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
     $oCriteria->add(UsersPeer::USR_UID, $aAdhocUsers, Criteria::IN);
     $oDataset = UsersPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $aData = array();
     while ($oDataset->next()) {
         $aData[] = $oDataset->getRow();
     }
     $this->data = $aData;
 }
开发者ID:nshong,项目名称:processmaker,代码行数:36,代码来源:adhocUserProxy.php


示例12: reassignCase

    /**

     * reassign Case

     *

     * @param string sessionId : The session ID (which was obtained during login)

     * @param string caseId : The case ID (which can be obtained with the caseList() function)

     * @param string delIndex : The delegation index number of the case (which can be obtained with the caseList()

     * function).

     * @param string userIdSource : The user who is currently assigned the case.

     * @param string userIdTarget : The target user who will be newly assigned to the case.

     * @return $result will return an object

     */

    public function reassignCase ($sessionId, $caseId, $delIndex, $userIdSource, $userIdTarget)

    {

        $g = new G();



        try {

            $g->sessionVarSave();



            $_SESSION["APPLICATION"] = $caseId;

            $_SESSION["INDEX"] = $delIndex;

            $_SESSION["USER_LOGGED"] = $userIdSource;



            if ($userIdTarget == $userIdSource) {

                $result = new wsResponse( 30, G::loadTranslation( 'ID_TARGET_ORIGIN_USER_SAME' ) );



                $g->sessionVarRestore();



                return $result;

            }



            /**

             * ****************( 1 )*****************

             */

            $oCriteria = new Criteria( 'workflow' );

            $oCriteria->add( UsersPeer::USR_STATUS, 'ACTIVE' );

            $oCriteria->add( UsersPeer::USR_UID, $userIdSource );

            $oDataset = UsersPeer::doSelectRS( $oCriteria );

            $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );

            $oDataset->next();

            $aRow = $oDataset->getRow();



            if (! is_array( $aRow )) {

                $result = new wsResponse( 31, G::loadTranslation( 'ID_INVALID_ORIGIN_USER' ) );



                $g->sessionVarRestore();



                return $result;

            }



            /**

//.........这里部分代码省略.........
开发者ID:nhenderson,项目名称:processmaker,代码行数:101,代码来源:class.wsBase.php


示例13: create

    /**
     * Create List Completed Table
     *
     * @param type $data
     * @return type
     *
     */
    public function create($data)
    {
        $criteria = new Criteria();
        $criteria->addSelectColumn(ListCompletedPeer::APP_UID);
        $criteria->add( ListCompletedPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
        $dataset = ListCompletedPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        if ($dataset->next()) {
            return 1;
        }

        $criteria = new Criteria();
        $criteria->addSelectColumn(ContentPeer::CON_VALUE);
        $criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
        $dataset = ContentPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();
        $data['APP_TITLE'] = $aRow['CON_VALUE'];


        $criteria = new Criteria();
        $criteria->addSelectColumn(ContentPeer::CON_VALUE);
        $criteria->add( ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
        $dataset = ContentPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();
        $data['APP_PRO_TITLE'] = $aRow['CON_VALUE'];


        $criteria = new Criteria();
        $criteria->addSelectColumn(ContentPeer::CON_VALUE);
        $criteria->add( ContentPeer::CON_ID, $data['TAS_UID'], Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
        $dataset = ContentPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();
        $data['APP_TAS_TITLE'] = $aRow['CON_VALUE'];


        $criteria = new Criteria();
        $criteria->addSelectColumn(UsersPeer::USR_USERNAME);
        $criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
        $criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
        $criteria->add( UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL );
        $dataset = UsersPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();
        $data['DEL_CURRENT_USR_USERNAME']  = $aRow['USR_USERNAME'];
        $data['DEL_CURRENT_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
        $data['DEL_CURRENT_USR_LASTNAME']  = $aRow['USR_LASTNAME'];
        $data['DEL_PREVIOUS'] = isset($data['DEL_PREVIOUS']) ? $data['DEL_PREVIOUS'] : "";

        if ($data['DEL_PREVIOUS'] != 0) {
            $criteria = new Criteria();
            $criteria->addSelectColumn(AppDelegationPeer::USR_UID);
            $criteria->add( AppDelegationPeer::DEL_INDEX, $data['DEL_PREVIOUS'], Criteria::EQUAL );
            $dataset = UsersPeer::doSelectRS($criteria);
            $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
            $dataset->next();
            $aRow = $dataset->getRow();
            $data['DEL_PREVIOUS_USR_UID']  = $aRow['USR_UID'];
        }

        //Update - WHERE
        $criteriaWhere = new Criteria("workflow");
        $criteriaWhere->add(ListParticipatedLastPeer::APP_UID, $data["APP_UID"], Criteria::EQUAL);
        //Update - SET
        $criteriaSet = new Criteria("workflow");
        $criteriaSet->add(ListParticipatedLastPeer::APP_STATUS, 'COMPLETED');
        BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));

        $users = new Users();
        $users->refreshTotal($data['USR_UID'], 'add', 'completed');
        if ($data['DEL_PREVIOUS'] != 0) {
            $criteria = new Criteria();
            $criteria->addSelectColumn(TaskPeer::TAS_TYPE);
            $criteria->add( TaskPeer::TAS_UID, $data['TAS_UID'], Criteria::EQUAL );
            $dataset = TaskPeer::doSelectRS($criteria);
            $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
            $dataset->next();
            $aRow = $dataset->getRow();
            if ($aRow['TAS_TYPE'] != 'SUBPROCESS') {
                $users->refreshTotal($data['USR_UID'], 'remove', 'inbox');
            }
//.........这里部分代码省略.........
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:101,代码来源:ListCompleted.php


示例14: getSelectForActiveMembersList

 /**
  * Return Select object for the active members list.
  * 
  * @param
  * @return coreDatabaseSelect
  */
 public static function getSelectForActiveMembersList()
 {
     return self::getInstance()->select(array(self::getInstance()->getName() . '.userid', 'username', 'location', 'fc_count', 'ts_lastreview' => 'UNIX_TIMESTAMP(last_review)'))->joinUsing(UsersPeer::getInstance()->getName(), 'userid');
 }
开发者ID:nikitakit,项目名称:RevTK,代码行数:10,代码来源:ActiveMembersPeer.php


示例15: fromArray

 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
  * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = UsersPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setUsrUid($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setUsrUsername($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setUsrPassword($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setUsrFirstname($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setUsrLastname($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setUsrEmail($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setUsrDueDate($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setUsrCreateDate($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setUsrUpdateDate($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setUsrStatus($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setUsrCountry($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setUsrCity($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setUsrLocation($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setUsrAddress($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setUsrPhone($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setUsrFax($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setUsrCellular($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setUsrZipCode($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setDepUid($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setUsrPosition($arr[$keys[19]]);
     }
     if (array_key_exists($keys[20], $arr)) {
         $this->setUsrResume($arr[$keys[20]]);
     }
     if (array_key_exists($keys[21], $arr)) {
         $this->setUsrBirthday($arr[$keys[21]]);
     }
     if (array_key_exists($keys[22], $arr)) {
         $this->setUsrRole($arr[$keys[22]]);
     }
     if (array_key_exists($keys[23], $arr)) {
         $this->setUsrReportsTo($arr[$keys[23]]);
     }
     if (array_key_exists($keys[24], $arr)) {
         $this->setUsrReplacedBy($arr[$keys[24]]);
     }
     if (array_key_exists($keys[25], $arr)) {
         $this->setUsrUx($arr[$keys[25]]);
     }
     if (array_key_exists($keys[26], $arr)) {
         $this->setUsrTotalInbox($arr[$keys[26]]);
     }
//.........这里部分代码省略.........
开发者ID:emildev35,项目名称:processmaker,代码行数:101,代码来源:BaseUsers.php


示例16: _getUXLocation

 /**
  * New feature - User Experience Redirector
  *
  * @author Erik Amaru Ortiz <[email protected]>
  */
 public function _getUXLocation()
 {
     require_once 'classes/model/Users.php';
     $u = UsersPeer::retrieveByPK($this->usrID);
     $url = '';
     $uxType = $u->getUsrUx();
     $_SESSION['user_experience'] = 'NORMAL';
     // find a group setting
     if ($uxType == '' || $uxType == 'NORMAL') {
         require_once 'classes/model/GroupUser.php';
         $gu = new GroupUser();
         $ugList = $gu->getAllUserGroups($this->usrID);
         foreach ($ugList as $row) {
             if ($row['GRP_UX'] != 'NORMAL' && $row['GRP_UX'] != '') {
                 $uxType = $row['GRP_UX'];
                 break;
             }
         }
     }
     switch ($uxType) {
         case 'SIMPLIFIED':
         case 'SWITCHABLE':
         case 'SINGLE':
             $_SESSION['user_experience'] = $uxType;
             $_SESSION['user_last_skin'] = SYS_SKIN;
             $url = '/sys' . SYS_SYS . '/' . $this->lang . '/uxs/' . 'home';
             break;
     }
     return $url;
 }
开发者ID:bqevin,项目名称:processmaker,代码行数:35,代码来源:UsersProperties.php


示例17: trim

$sWS_USER = trim($_REQUEST['USERNAME']);
$sWS_PASS = trim($_REQUEST['PASSWORD']);
if (G::is_https()) {
    $http = 'https://';
} else {
    $http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@($client = new SoapClient($endpoint));
$user = $sWS_USER;
$pass = $sWS_PASS;
$params = array('userid' => $user, 'password' => $pass);
$result = $client->__SoapCall('login', array($params));
$fields['status_code'] = $result->status_code;
$fields['message'] = 'ProcessMaker WebService version: ' . $result->version . "\n" . $result->message;
$fields['version'] = $result->version;
$fields['time_stamp'] = $result->timestamp;
$messageCode = $result->message;
if ($result->status_code == 0) {
    if (!class_exists('Users')) {
        require "classes/model/UsersPeer.php";
    }
    $oCriteria = new Criteria('workflow');
    $oCriteria->addSelectColumn('USR_UID');
    $oCriteria->add(UsersPeer::USR_USERNAME, $sWS_USER);
    $resultSet = UsersPeer::doSelectRS($oCriteria);
    $resultSet->next();
    $user_id = $resultSet->getRow();
    $messageCode = $user_id[0];
}
echo $messageCode;
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:cases_SchedulerValidateUser.php


示例18: getTaskAdhocAssigneesAll

 /**
  * Return a list of adhoc assignees of an activity
  *
  * @param string $sProcessUID {@min 32} {@max 32}
  * @param string $sTaskUID {@min 32} {@max 32}
  * @param string $filter
  * @param int    $start
  * @param int    $limit
  * @param string $type
  *
  * return array
  *
  * @access public
  */
 public function getTaskAdhocAssigneesAll($sProcessUID, $sTaskUID, $filter, $start, $limit, $type)
 {
     try {
         Validator::proUid($sProcessUID, '$prj_uid');
         $this->validateActUid($sTaskUID);
         $aUsers = array();
         $oTasks = new \Tasks();
         $aAux = $oTasks->getGroupsOfTask($sTaskUID, 2);
         $aGroupUids = array();
         foreach ($aAux as $aGroup) {
             $aGroupUids[] = $aGroup['GRP_UID'];
         }
         foreach ($aGroupUids as $results) {
             $oCriteria = new \Criteria('workflow');
             $oCriteria->addSelectColumn('USR_UID');
             $oCriteria->add(\GroupUserPeer::GRP_UID, $results);
             $oGroupDataset = \GroupUserPeer::doSelectRS($oCriteria);
             $oGroupDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
             while ($oGroupDataset->next()) {
                 $aGroupRow = $oGroupDataset->getRow();
                 $oGroupCriteria = new \Criteria('workflow');
                 $oGroupCriteria->addSelectColumn(\UsersPeer::USR_UID);
                 $oGroupCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
                 $oGroupCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
                 $oGroupCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
                 if ($filter != '') {
                     $oGroupCriteria->add($oGroupCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, "%{$filter}%", \Criteria::LIKE)->addOr($oGroupCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, "%{$filter}%", \Criteria::LIKE))->addOr($oGroupCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME, "%{$filter}%", \Criteria::LIKE)));
                 }
                 $oGroupCriteria->add(\UsersPeer::USR_UID, $aGroupRow["USR_UID"]);
                 $oUserDataset = \UsersPeer::doSelectRS($oGroupCriteria);
                 $oUserDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
                 $oUserDataset->next();
                 while ($aUserRow = $oUserDataset->getRow()) {
                     $aUsers[] = array('aas_uid' => $aUserRow['USR_UID'], 'aas_name' => $aUserRow['USR_FIRSTNAME'], 'aas_lastname' => $aUserRow['USR_LASTNAME'], 'aas_username' => $aUserRow['USR_USERNAME'], 'aas_type' => "user");
                     $oUserDataset->next();
                 }
             }
         }
         $oCriteria = new \Criteria('workflow');
         $oCriteria->addSelectColumn(\UsersPeer::USR_UID);
         $oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
         $oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
         $oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
         if ($filter != '') {
             $oCriteria->add($oCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, "%{$filter}%", \Criteria::LIKE)->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, "%{$filter}%", \Criteria::LIKE))->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME, "%{$filter}%", \Criteria::LIKE)));
         }
         $oCriteria->addJoin(\TaskUserPeer::USR_UID, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN);
         $oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID);
         $oCriteria->add(\TaskUserPeer::TU_TYPE, 2);
         $oCriteria->add(\TaskUserPeer::TU_RELATION, 1);
         $oDataset = \TaskUserPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             if ($type == '' || $type == 'user') {
                 $aUsers[] = array('aas_uid' => $aRow['USR_UID'], 'aas_name' => $aRow['USR_FIRSTNAME'], 'aas_lastname' => $aRow['USR_LASTNAME'], 'aas_username' => $aRow['USR_USERNAME'], 'aas_type' => "user");
             }
             $oDataset->next();
         }
         $aUsersGroups = array();
         $exclude = array("");
         for ($i = 0; $i <= count($aUsers) - 1; $i++) {
             if (!in_array(trim($aUsers[$i]["aas_uid"]), $exclude)) {
                 $aUsersGroups[] = $aUsers[$i];
                 $exclude[] = trim($aUsers[$i]["aas_uid"]);
             }
         }
         if ($start) {
             if ($start < 0) {
                 throw new \Exception(\G::LoadTranslation("ID_INVALID_START"));
             }
         } else {
             $start = 0;
         }
         if (isset($limit)) {
             if ($limit < 0) {
                 throw new \Exception(\G::LoadTranslation("ID_INVALID_LIMIT"));
             } else {
                 if ($limit == 0) {
                     return array();
                 }
             }
         } else {
             $limit = count($aUsersGroups) + 1;
         }
         $aUsersGroups = $this->arrayPagination($aUsersGroups, $start, $limit);
//.........这里部分代码省略.........
开发者ID:emildev35,项目名称:processmaker,代码行数:101,代码来源:Task.php


示例19: newRow

    public function newRow ($data, $delPreviusUsrUid, $isInitSubprocess = false, $dataPreviusApplication = array(), $isSelfService = false)
    {
        $removeList = true;
        if (isset($data['REMOVED_LIST'])) {
            $removeList = $data['REMOVED_LIST'];
            unset($data['REMOVED_LIST']);
        }
        $data['DEL_PREVIOUS_USR_UID'] = $delPreviusUsrUid;
        if (isset($data['DEL_TASK_DUE_DATE'])) {
            $data['DEL_DUE_DATE'] = $data['DEL_TASK_DUE_DATE'];
        }

        $criteria = new Criteria();
        $criteria->addSelectColumn( ApplicationPeer::APP_NUMBER );
        $criteria->addSelectColumn( ApplicationPeer::APP_UPDATE_DATE );
        $criteria->add( ApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
        $dataset = ApplicationPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();
        $data = array_merge($data, $aRow);


        $criteria = new Criteria();
        $criteria->addSelectColumn(ContentPeer::CON_VALUE);
        $criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
        $dataset = ContentPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();
        $data['APP_TITLE'] = $aRow['CON_VALUE'];


        $criteria = new Criteria();
        $criteria->addSelectColumn(ContentPeer::CON_VALUE);
        $criteria->add( ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
        $dataset = ContentPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();
        $data['APP_PRO_TITLE'] = $aRow['CON_VALUE'];


        $criteria = new Criteria();
        $criteria->addSelectColumn(ContentPeer::CON_VALUE);
        $criteria->add( ContentPeer::CON_ID, $data['TAS_UID'], Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
        $dataset = ContentPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();
        $data['APP_TAS_TITLE'] = $aRow['CON_VALUE'];


        $data['APP_PREVIOUS_USER'] = '';
        if ($data['DEL_PREVIOUS_USR_UID'] != '') {
            $criteria = new Criteria();
            $criteria->addSelectColumn(UsersPeer::USR_USERNAME);
            $criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
            $criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
            $criteria->add( UsersPeer::USR_UID, $data['DEL_PREVIOUS_USR_UID'], Criteria::EQUAL );
            $dataset = UsersPeer::doSelectRS($criteria);
            $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
            $dataset->next();
            $aRow = $dataset->getRow();
            $data['DEL_PREVIOUS_USR_USERNAME']  = $aRow['USR_USERNAME'];
            $data['DEL_PREVIOUS_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
            $data['DEL_PREVIOUS_USR_LASTNAME']  = $aRow['USR_LASTNAME'];
        }

        $users = new Users();
        $criteria = new Criteria();
        $criteria->addSelectColumn(SubApplicationPeer::DEL_INDEX_PARENT);
        $criteria->add( SubApplicationPeer::APP_PARENT, $data['APP_UID'], Criteria::EQUAL );
        $dataset = SubApplicationPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        if ($dataset->next()) {
            $aSub = $dataset->getRow();
            if ($aSub['DEL_INDEX_PARENT'] == $data['DEL_PREVIOUS'] && !$isSelfService) {
                $users->refreshTotal($data['USR_UID'], 'add', 'inbox');
                self::create($data, $isSelfService);
                return 1;
            }
        }

        if (!$isInitSubprocess) {
            if ($data['APP_STATUS'] == 'DRAFT') {
                $users->refreshTotal($data['USR_UID'], 'add', 'draft');
            } else {
                $oRow = ApplicationPeer::retrieveByPK($data['APP_UID']);
                $aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
                if ($removeList) {
                    if ($data['DEL_INDEX'] == 2 || $aFields['APP_STATUS'] == 'DRAFT') {
                        $criteria = new Criteria();
                        $criteria->addSelectColumn(SubApplicationPeer::APP_UID);
//.........这里部分代码省略.........
开发者ID:rrsc,项目名称:processmaker,代码行数:101,代码来源:ListInbox.php


示例20: create

    /**
     * Create List Paused Table
     *
     * @param type $data
     * @return type
     *
     */
    public function create($data)
    {
        $criteria = new Criteria();
        $criteria->addSelectColumn(ContentPeer::CON_VALUE);
        $criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
        $dataset = ContentPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();
        $data['APP_TITLE'] = $aRow['CON_VALUE'];

        $criteria = new Criteria();
        $criteria->addSelectColumn(ContentPeer::CON_VALUE);
        $criteria->add( ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
        $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
        $dataset = ContentPeer::doSelectRS($criteria);
        $dataset->setFetchmode(Resu 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Users_Privileges_Model类代码示例发布时间:2022-05-23
下一篇:
PHP UsersLastImport类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap