本文整理汇总了PHP中EnmasseHelper::getUserByName方法的典型用法代码示例。如果您正苦于以下问题:PHP EnmasseHelper::getUserByName方法的具体用法?PHP EnmasseHelper::getUserByName怎么用?PHP EnmasseHelper::getUserByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnmasseHelper
的用法示例。
在下文中一共展示了EnmasseHelper::getUserByName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteList
function deleteList($cids)
{
$row = $this->getTable();
$nGroup = JModel::getInstance('setting', 'EnmasseModel')->getSetting(1)->merchant_group;
foreach ($cids as $cid) {
$row->load($cid);
if (!$row->delete()) {
$this->setError($row->getErrorMsg());
return false;
}
//remove merchant group for this user from joomla user group table
$jUserId = EnmasseHelper::getUserByName($row->user_name)->id;
$user = new JUser($jUserId);
$user->groups = array_diff($user->groups, array($nGroup));
$user->save();
}
return true;
}
示例2: checkUserName
public function checkUserName()
{
$userName = JRequest::getVar("userName");
$nMerId = JRequest::getVar("mer_id", null);
$user = EnmasseHelper::getUserByName($userName);
$merchant = JModel::getInstance('merchant', 'enmasseModel')->checkUserNameDup($userName, $nMerId);
if (!empty($user)) {
if (!empty($merchant)) {
echo 'duplicated';
} else {
echo 'valid';
}
} else {
echo 'invalid';
}
exit(0);
}
示例3: store
/**
*
* Store merchant data into the DB
* @param array $data
* @return boolean true on success
*/
public function store($data)
{
$oRow = JTable::getInstance('merchant', 'Table');
if (!$oRow->bind($data)) {
$this->setError($oRow->getError());
return false;
}
if (empty($oRow->id)) {
$oRow->created_at = DatetimeWrapper::getDatetimeOfNow();
}
$oRow->updated_at = DatetimeWrapper::getDatetimeOfNow();
if (!$oRow->check()) {
$this->setError($oRow->getError());
return false;
}
if (!$oRow->store()) {
$this->setError($oRow->getError());
return false;
}
//set group for the merchant person
$jUserId = EnmasseHelper::getUserByName($data['user_name'])->id;
$nGroup = JModel::getInstance('setting', 'EnmasseModel')->getSetting(1)->merchant_group;
$user = new JUser($jUserId);
$user->groups = array_merge($user->groups, array($nGroup));
$user->save();
return true;
}
示例4: checkUserName
function checkUserName()
{
$userName = JRequest::getVar("userName");
$user = EnmasseHelper::getUserByName($userName);
$userByUserName = JModel::getInstance('salesperson', 'enmasseModel')->getSaleByUserName($userName);
if (!empty($user)) {
if (!empty($userByUserName)) {
echo 'duplicated';
} else {
echo 'valid';
}
} else {
echo 'invalid';
}
exit(0);
}