本文整理汇总了PHP中Model\User::getUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getUsers方法的具体用法?PHP User::getUsers怎么用?PHP User::getUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model\User
的用法示例。
在下文中一共展示了User::getUsers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkinstallrequirement
/**
* Check if there is no user in system before run install
*/
private function checkinstallrequirement()
{
$needInstall = false;
//Check User tables exists
if (!$this->usertablesExists()) {
$needInstall = true;
} else {
$userCount = \Model\User::getUsers(array(), '', '', '', true);
if ($userCount > 0) {
$needInstall = false;
} else {
$needInstall = true;
}
}
return $needInstall;
}
示例2: jsondataAction
public function jsondataAction()
{
$formData = array();
$this->registry->session->set('securityToken', Helper::getSecurityToken());
//Token
$page = $this->getCurrentPage();
$emailFilter = (string) $this->postBag->get('email');
$groupidFilter = (int) $this->postBag->get('groupid');
$regionFilter = (int) $this->postBag->get('region');
$genderFilter = (int) $this->postBag->get('gender');
$idFilter = (int) $this->postBag->get('id');
$keywordFilter = Helper::plaintext($this->postBag->get('keyword'));
$searchKeywordIn = (string) $this->postBag->get('searchin');
//check sort column condition
$sortby = $this->postBag->get('sortby');
if ($sortby == '') {
$sortby = 'id';
}
$formData['sortby'] = $sortby;
$sorttype = $this->postBag->get('sorttype');
if (strtoupper($sorttype) != 'ASC') {
$sorttype = 'DESC';
}
$formData['sorttype'] = $sorttype;
if ($emailFilter != "") {
$formData['femail'] = $emailFilter;
}
if ($groupidFilter > 0) {
$formData['fgroupid'] = $groupidFilter;
}
if ($regionFilter > 0) {
$formData['fregion'] = $regionFilter;
}
if ($genderFilter > 0) {
$formData['fgender'] = $genderFilter;
}
if ($idFilter > 0) {
$formData['fid'] = $idFilter;
}
if (strlen($keywordFilter) > 0) {
if ($searchKeywordIn == 'screenname') {
} elseif ($searchKeywordIn == 'fullname') {
}
$formData['fkeyword'] = $formData['fkeywordFilter'] = $keywordFilter;
$formData['fsearchin'] = $formData['fsearchKeywordIn'] = $searchKeywordIn;
}
//tim tong so
$total = \Model\User::getUsers($formData, $sortby, $sorttype, 0, true);
//get latest account
$Users = \Model\User::getUsers($formData, $sortby, $sorttype, ($page - 1) * $this->recordPerPage . ',' . $this->recordPerPage);
$jsondata = array();
$jsondata['total'] = (int) $total;
$jsondata['totalpage'] = (int) ceil($total / $this->recordPerPage);
$jsondata['page'] = (int) $page;
$jsondata['token'] = (string) $this->registry->session->get('securityToken');
$jsondata['sortby'] = (string) $sortby;
$jsondata['sorttype'] = (string) $sorttype;
$jsondata['primaryproperty'] = 'id';
$jsondata['editurlprefix'] = $this->registry->conf['rooturl_admin'] . $this->registry->controller . '/edit/id/';
$jsondata['deleteurlprefix'] = $this->registry->conf['rooturl_admin'] . $this->registry->controller . '/delete/id/';
$jsondata['items'] = array();
foreach ($Users as $myUser) {
$jsondata['items'][] = array('id' => (int) $myUser->id, 'email' => (string) $myUser->email, 'fullname' => (string) $myUser->fullname, 'groupid' => (string) $myUser->getGroupName(), 'gender' => (string) $myUser->getGenderText(), 'region' => (string) $myUser->getRegionName(), 'datecreated' => date('d/m/Y', $myUser->datecreated), 'datelastaction' => date('H:i:s, d/m/Y', $myUser->datelastaction));
}
$this->registry->response->headers->set('Content-type', 'text/json');
$contents = json_encode($jsondata);
$this->registry->response->setContent($contents);
}
示例3: submitValidate
protected function submitValidate($formData, &$error)
{
$pass = true;
//check form token
if ($formData['ftoken'] != $this->registry->session->get('forgotpassToken')) {
$pass = false;
$error[] = $this->registry->lang['default']['securityTokenInvalid'];
}
//check spam
$forgotpassExpire = 10;
//seconds
if ($this->registry->session->has('forgotpassSpam') && time() - $this->registry->session->get('forgotpassSpam') < $forgotpassExpire) {
$error[] = $this->registry->lang['controller']['errSpam'];
$pass = false;
}
//check email length
if (!\Litpi\Helper::validateEmail($formData['femail'])) {
$error[] = $this->registry->lang['controller']['errInvalidEmail'];
$pass = false;
} else {
$myUser = \Model\User::getUsers(array('femail' => $formData['femail']));
if ($myUser[0]->id == 0) {
$error[] = $this->registry->lang['controller']['errAccountInvalid'];
$pass = false;
}
}
return $pass;
}