本文整理汇总了PHP中UsersPeer::doCount方法的典型用法代码示例。如果您正苦于以下问题:PHP UsersPeer::doCount方法的具体用法?PHP UsersPeer::doCount怎么用?PHP UsersPeer::doCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UsersPeer
的用法示例。
在下文中一共展示了UsersPeer::doCount方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUsersFullNameFromArray
function getUsersFullNameFromArray ($aUsers)
{
$oUser = new Users();
$aUsersData = array ();
if (is_array( $aUsers )) {
foreach ($aUsers as $key => $val) {
// $userFields = $oUser->load( $val );
$userFields = $oUser->userVacation( $val );
$auxFields['USR_UID'] = $userFields['USR_UID'];
$auxFields['USR_USERNAME'] = $userFields['USR_USERNAME'];
$auxFields['USR_FIRSTNAME'] = $userFields['USR_FIRSTNAME'];
$auxFields['USR_LASTNAME'] = $userFields['USR_LASTNAME'];
$auxFields['USR_FULLNAME'] = $userFields['USR_LASTNAME'] . ($userFields['USR_LASTNAME'] != '' ? ', ' : '') . $userFields['USR_FIRSTNAME'];
$auxFields['USR_EMAIL'] = $userFields['USR_EMAIL'];
$auxFields['USR_STATUS'] = $userFields['USR_STATUS'];
$auxFields['USR_COUNTRY'] = $userFields['USR_COUNTRY'];
$auxFields['USR_CITY'] = $userFields['USR_CITY'];
$auxFields['USR_LOCATION'] = $userFields['USR_LOCATION'];
$auxFields['DEP_UID'] = $userFields['DEP_UID'];
$auxFields['USR_HIDDEN_FIELD'] = '';
$aUsersData[] = $auxFields;
}
} else {
$oCriteria = new Criteria();
$oCriteria->add( UsersPeer::USR_UID, $aUsers );
if (UsersPeer::doCount( $oCriteria ) < 1) {
return null;
}
$userFields = $oUser->load( $aUsers );
$auxFields['USR_UID'] = $userFields['USR_UID'];
$auxFields['USR_USERNAME'] = $userFields['USR_USERNAME'];
$auxFields['USR_FIRSTNAME'] = $userFields['USR_FIRSTNAME'];
$auxFields['USR_LASTNAME'] = $userFields['USR_LASTNAME'];
$auxFields['USR_FULLNAME'] = $userFields['USR_LASTNAME'] . ($userFields['USR_LASTNAME'] != '' ? ', ' : '') . $userFields['USR_FIRSTNAME'];
$auxFields['USR_EMAIL'] = $userFields['USR_EMAIL'];
$auxFields['USR_STATUS'] = $userFields['USR_STATUS'];
$auxFields['USR_COUNTRY'] = $userFields['USR_COUNTRY'];
$auxFields['USR_CITY'] = $userFields['USR_CITY'];
$auxFields['USR_LOCATION'] = $userFields['USR_LOCATION'];
$auxFields['DEP_UID'] = $userFields['DEP_UID'];
$aUsersData = $auxFields;
}
return $aUsersData;
}
示例2: md5
$form['USR_PASSWORD'] = md5($form['USR_NEW_PASS']);
}
if (!isset($form['USR_CITY'])) {
$form['USR_CITY'] = '';
}
if (!isset($form['USR_LOCATION'])) {
$form['USR_LOCATION'] = '';
}
if (!isset($form['USR_AUTH_USER_DN'])) {
$form['USR_AUTH_USER_DN'] = '';
}
if ($form['USR_UID'] == '') {
$criteria = new Criteria();
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$criteria->add(UsersPeer::USR_USERNAME, utf8_encode($_POST['USR_USERNAME']));
if (UsersPeer::doCount($criteria) > 0) {
throw new Exception(G::LoadTranslation('ID_USERNAME_ALREADY_EXISTS', array('USER_ID' => $_POST['USR_USERNAME'])));
}
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
$aData['USR_FIRSTNAME'] = $form['USR_FIRSTNAME'];
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
$aData['USR_DUE_DATE'] = $form['USR_DUE_DATE'];
$aData['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
$aData['USR_BIRTHDAY'] = date('Y-m-d');
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
//fixing bug in inactive user when the admin create a new user.
$statusWF = $form['USR_STATUS'];
$aData['USR_STATUS'] = $form['USR_STATUS'] == 'ACTIVE' ? 1 : 0;
示例3: getDepartments
public function getDepartments($DepParent)
{
try {
$result = array();
$criteria = new Criteria('workflow');
$criteria->add(DepartmentPeer::DEP_PARENT, $DepParent, Criteria::EQUAL);
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
$objects = DepartmentPeer::doSelect($criteria, $con);
$oUsers = new Users();
foreach ($objects as $oDepartment) {
$node = array();
$node['DEP_UID'] = $oDepartment->getDepUid();
$node['DEP_PARENT'] = $oDepartment->getDepParent();
$node['DEP_TITLE'] = $oDepartment->getDepTitle();
$node['DEP_STATUS'] = $oDepartment->getDepStatus();
$node['DEP_MANAGER'] = $oDepartment->getDepManager();
$node['DEP_LDAP_DN'] = $oDepartment->getDepLdapDn();
$node['DEP_LAST'] = 0;
$manager = $oDepartment->getDepManager();
if ($manager != '') {
$UserUID = $oUsers->load($manager);
$node['DEP_MANAGER_USERNAME'] = isset($UserUID['USR_USERNAME']) ? $UserUID['USR_USERNAME'] : '';
$node['DEP_MANAGER_FIRSTNAME'] = isset($UserUID['USR_FIRSTNAME']) ? $UserUID['USR_FIRSTNAME'] : '';
$node['DEP_MANAGER_LASTNAME'] = isset($UserUID['USR_LASTNAME']) ? $UserUID['USR_LASTNAME'] : '';
} else {
$node['DEP_MANAGER_USERNAME'] = '';
$node['DEP_MANAGER_FIRSTNAME'] = '';
$node['DEP_MANAGER_LASTNAME'] = '';
}
$criteria = new \Criteria();
$criteria->add(UsersPeer::DEP_UID, $node['DEP_UID'], \Criteria::EQUAL);
$node['DEP_MEMBERS'] = UsersPeer::doCount($criteria);
$criteriaCount = new Criteria('workflow');
$criteriaCount->clearSelectColumns();
$criteriaCount->addSelectColumn('COUNT(*)');
$criteriaCount->add(DepartmentPeer::DEP_PARENT, $oDepartment->getDepUid(), Criteria::EQUAL);
$rs = DepartmentPeer::doSelectRS($criteriaCount);
$rs->next();
$row = $rs->getRow();
$node['HAS_CHILDREN'] = $row[0];
$result[] = $node;
}
if (count($result) >= 1) {
$result[count($result) - 1]['DEP_LAST'] = 1;
}
return $result;
} catch (exception $e) {
throw $e;
}
}
示例4: getWorkspaceInfo
/**
* Will return all the information of a WS.
* - Status
* - # of cases
* - # of processes
* - # of users
* @param string $wsName
* @return array
*/
function getWorkspaceInfo($wsName)
{
$aResult = array('num_processes' => '0', 'num_cases' => '0');
$result = array();
require_once 'classes/model/Process.php';
require_once 'classes/model/Application.php';
require_once 'classes/model/Users.php';
$Criteria = new Criteria('workflow');
$Criteria->add(ProcessPeer::PRO_STATUS, 'ACTIVE', CRITERIA::EQUAL);
$aResult['num_processes'] = ProcessPeer::doCount($Criteria);
$Criteria = new Criteria('workflow');
$Criteria->add(ApplicationPeer::APP_STATUS, 'COMPLETED', CRITERIA::NOT_EQUAL);
$aResult['num_cases'] = ApplicationPeer::doCount($Criteria);
$Criteria = new Criteria('workflow');
$Criteria->add(UsersPeer::USR_STATUS, array('DELETED', 'DISABLED'), CRITERIA::NOT_IN);
$aResult['num_users'] = UsersPeer::doCount($Criteria);
return $aResult;
}
示例5: editExtObjectPermission
/**
* editObjectPermission
*
* @param string $sOP_UID
* @param string $sProcessUID
* @return void
*/
public function editExtObjectPermission($sProcessUID, $sOP_UID)
{
$oCriteria = new Criteria();
$oCriteria->add(ObjectPermissionPeer::OP_UID, $sOP_UID);
$oDataset = ObjectPermissionPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRows = $oDataset->getRow();
$oCriteria = new Criteria();
$oCriteria->add(GroupwfPeer::GRP_UID, $aRows['USR_UID']);
if (GroupwfPeer::doCount($oCriteria) == 1) {
$user = '2|' . $aRows['USR_UID'];
}
$oCriteria = new Criteria();
$oCriteria->add(UsersPeer::USR_UID, $aRows['USR_UID']);
if (UsersPeer::doCount($oCriteria) == 1) {
$user = '1|' . $aRows['USR_UID'];
}
$aFields['LANG'] = SYS_LANG;
$aFields['OP_UID'] = $aRows['OP_UID'];
$aFields['PRO_UID'] = $aRows['PRO_UID'];
$aFields['OP_CASE_STATUS'] = $aRows['OP_CASE_STATUS'];
$aFields['TAS_UID'] = $aRows['TAS_UID'];
$aFields['OP_GROUP_USER'] = $user;
$aFields['OP_TASK_SOURCE'] = $aRows['OP_TASK_SOURCE'];
$aFields['OP_PARTICIPATE'] = $aRows['OP_PARTICIPATE'];
$aFields['OP_OBJ_TYPE'] = $aRows['OP_OBJ_TYPE'];
$aFields['OP_ACTION'] = $aRows['OP_ACTION'];
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$aFields['TASK_TARGET_NAME'] = Content::load('TAS_TITLE', '', $aRows['TAS_UID'], $lang);
$aFields['TASK_SOURCE_NAME'] = Content::load('TAS_TITLE', '', $aRows['OP_TASK_SOURCE'], $lang);
$oUser = UsersPeer::retrieveByPK($aRows['USR_UID']);
if (!is_null($oUser)) {
$aFields['USR_FULLNAME'] = $oUser->getUsrFirstname() . ' ' . $oUser->getUsrLastname();
} else {
throw new Exception("The row '" . $aRows['USR_UID'] . "' in table USER doesn't exist!");
}
switch ($aRows['OP_OBJ_TYPE']) {
/* case 'ANY':
$aFields['OP_OBJ_TYPE'] = '';
break;
*/
case 'DYNAFORM':
$aFields['DYNAFORM'] = $aRows['OP_OBJ_UID'];
$aFields['DYNAFORM_NAME'] = Content::load('DYN_TITLE', '', $aRows['OP_OBJ_UID'], $lang);
break;
case 'INPUT':
$aFields['INPUT'] = $aRows['OP_OBJ_UID'];
$aFields['INPUT_NAME'] = Content::load('INP_DOC_TITLE', '', $aRows['OP_OBJ_UID'], $lang);
break;
case 'OUTPUT':
$aFields['OUTPUT'] = $aRows['OP_OBJ_UID'];
$aFields['OUTPUT_NAME'] = Content::load('OUT_DOC_TITLE', '', $aRows['OP_OBJ_UID'], $lang);
break;
}
return $aFields;
}
示例6: enterpriseLimitCreateUser
public function enterpriseLimitCreateUser()
{
G::LoadClass('serverConfiguration');
$oServerConf =& serverConf::getSingleton();
$infoLicense = $oServerConf->getProperty('LICENSE_INFO');
if (isset($infoLicense[SYS_SYS]['LIMIT_USERS'])) {
$criteria = new Criteria('workflow');
$criteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
$count = UsersPeer::doCount($criteria);
if ($count >= $infoLicense[SYS_SYS]['LIMIT_USERS']) {
throw new Exception("You can\\'t add more users to the System, this reach the limit of allowed users by license that it has installed now");
}
}
}
示例7: executeCron
//.........这里部分代码省略.........
$count++;
//(G) Update Users
//if (!isset($arrayGroupUserAd[$registeredGroup["GRP_UID"]])) {
// $arrayGroupUserAd[$registeredGroup["GRP_UID"]] = array(); //Current users in group based in Active Directory
//}
//
//$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
//$arrayAux = array_merge($arrayGroupUserAd[$registeredGroup["GRP_UID"]], $arrayAux);
//
//$arrayGroupUserAd[$registeredGroup["GRP_UID"]] = array_unique($arrayAux);
$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
}
//Group - Print log
$logResults = sprintf("- Groups -> Existing users: %d, moved: %d, impossible: %d, created: %d, removed: %d", $this->gAlready, $this->gMoved, $this->gImpossible, $this->gCreated, $this->gRemoved);
$plugin->frontEndShow("TEXT", $logResults);
$plugin->log(null, $logResults);
//Manager
$plugin->clearManager($this->managersToClear);
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"] as $departmentUID) {
// Delete manager assignments
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
// Delete department assignments
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::DEP_UID, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
$this->dMoved += UsersPeer::doCount($criteriaWhere);
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
}
}
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"]);
$rbac =& RBAC::getSingleton();
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
}
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"] as $groupUID) {
// Delete manager assignments
$groupsInstance = new Groups();
$criteria = $groupsInstance->getUsersGroupCriteria($groupUID);
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$users = array();
while ($row = $dataset->getRow()) {
$users[] = $row["USR_UID"];
$dataset->next();
}
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::USR_UID, $users, Criteria::IN);
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
// Delete group assignments
$criteria = new Criteria("workflow");
$criteria->add(GroupUserPeer::GRP_UID, $groupUID);
$this->gMoved += GroupUserPeer::doCount($criteria);
BasePeer::doDelete($criteria, Propel::getConnection("workflow"));