本文整理匯總了PHP中DaoFactory::UserMst方法的典型用法代碼示例。如果您正苦於以下問題:PHP DaoFactory::UserMst方法的具體用法?PHP DaoFactory::UserMst怎麽用?PHP DaoFactory::UserMst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DaoFactory
的用法示例。
在下文中一共展示了DaoFactory::UserMst方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: perform
/**
* ユーザマスタの保存が成功したかJSON形式で返す
* @access public
* @see Admin_ActionClass::perform()
*/
function perform()
{
// get request params
$user_id_arr = $this->af->get('user_id_arr');
// get session params
$s_user_id = $this->session->get('user_id');
$company_id = $this->session->get('company_id');
// dao
$userDao = DaoFactory::UserMst();
try {
// begin
$userDao->BeginTransaction();
if ($_REQUEST['del'] == 'all') {
$userDao->Delete(' company_id = ? AND user_id <> ? ', array($company_id, $s_user_id));
} else {
foreach ($user_id_arr as $user_id) {
$userDao->Delete('company_id = ? AND user_id = ? ', array($company_id, $user_id));
}
}
// commit
$userDao->CommitTransaction();
} catch (Exception $e) {
// rollback
$userDao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array(500, $e->getMessage());
}
exit;
}
示例2: authenticate
function authenticate()
{
$this->af->setApp('app_name', $this->config->get('app_name'));
// ログインチェック
$login = new LoginController();
if (!$login->isLogin()) {
return 'login';
}
// パスワード期限チェック
$company_id = $this->session->get('company_id');
$user_id = $this->session->get('user_id');
$params = array('company_id' => $company_id, 'user_id' => $user_id);
if (DaoFactory::UserMst()->isExpiredPassword($params)) {
return 'password_list';
}
// get params
$kengen_flg = intval($this->session->get('kengen_flg'));
// 権限取得
// 権限フラグチェック
if ($kengen_flg != Konst::KENGEN_FLG_KANRI && $kengen_flg != Konst::KENGEN_FLG_SUPER) {
// 管理者ユーザ(8)、スーパーユーザ(9)以外であれば弾く
$login->Logout();
return 'login';
}
$locale = $this->session->get('current_locale');
if ($locale) {
$this->backend->getController()->setLocale($locale);
}
$this->setGuideModal();
$this->checkLicense();
return null;
}
示例3: perform
/**
* ユーザアンロックが成功したかJSON形式で返す
* @access public
* @see Admin_ActionClass::perform()
*/
function perform()
{
// get request params
$user_id_arr = $this->af->get('user_id_arr');
// get session params
$company_id = $this->session->get('company_id');
$s_user_id = $this->session->get('user_id');
// dao
$userDao = DaoFactory::UserMst();
try {
// begin
$userDao->BeginTransaction();
foreach ($user_id_arr as $user_id) {
// exists ( user_id )
$exist = $userDao->Retrieve(' company_id = ? AND user_id = ?', array($company_id, $user_id));
if (empty($exist)) {
$def1 = $this->af->getDef('user_id');
$err_msg = array('user_id' => "入力された" . $def1['name'] . "は登録されていません");
return array(400, $err_msg);
}
// set params
$params = array('PWD_UNLOCK' => '', 'UID' => $s_user_id, 'PGM' => get_class());
// dao insert
$userDao->Update($params, ' company_id = ? AND user_id = ? ', array($company_id, $user_id));
}
// commit
$userDao->CommitTransaction();
} catch (Exception $e) {
$userDao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array(500, $e->getMessage());
}
exit;
}
示例4: validateParams
function validateParams($params)
{
$error_message_list = array();
// 現在のパスワード
$UserMst = DaoFactory::UserMst();
$userData = $UserMst->UserMst_GetByUserId($params);
if ($params['current_pwd'] == '') {
$error_message_list['current_pwd'] = '現在のパスワードが入力されていません。';
} else {
if ($userData['USER_PWD'] != $params['current_pwd_hash']) {
$error_message_list['current_pwd'] = '現在のパスワードが正しくありません。';
}
}
// 新しいパスワード
if ($params['new_pwd1'] == '') {
$error_message_list['new_pwd1'] = '新しいパスワードが入力されていません。';
}
// 新しいパスワード(確認用)
if ($params['new_pwd2'] == '') {
$error_message_list['new_pwd2'] = '新しいパスワード(確認用)が入力されていません。';
}
if ($params['new_pwd1'] != $params['new_pwd2']) {
$error_message_list['new_pwd1'] = '二つの新しいパスワードの入力內容が異なっています。';
}
return $error_message_list;
}
示例5: perform
/**
* ユーザマスタの保存が成功したかJSON形式で返す
* @access public
* @see Admin_ActionClass::perform()
*/
function perform()
{
// get request params
$user_id = $this->af->get('user_id');
$login_id = $this->af->get('login_id');
$user_name = $this->af->get('user_name');
$e_mail = $this->af->get('e_mail');
$role_id = $this->af->get('role_id');
$default_locale = $this->af->get('default_locale');
// get session params
$company_id = $this->session->get('company_id');
$s_user_id = $this->session->get('user_id');
// dao
$userDao = DaoFactory::UserMst();
$roleDao = DaoFactory::RoleMst();
try {
// begin
$userDao->BeginTransaction();
// exists ( user_id, login_id )
$exist = $userDao->Retrieve(' company_id = ? AND user_id = ?', array($company_id, $user_id));
if (empty($exist)) {
$def1 = $this->af->getDef('user_id');
$err_msg = array('user_id' => "入力された" . $def1['name'] . "は登録されていません");
return array(400, $err_msg);
}
// 入力したログインIDとuser_idで引っ張ってきたログインIDを比較し、
// 異なっていれば(変更しようとしていれば)login_idの一意チェックを行う
if ($exist['LOGIN_ID'] !== $login_id) {
// exists ( user_id, login_id )
$wheresql = ' company_id = ? AND login_id = ? ';
$bindarr = array($company_id, $login_id);
$exist = $userDao->Retrieve($wheresql, $bindarr);
if (!empty($exist)) {
$def = $this->af->getDef('login_id');
$err_msg = array('login_id' => "入力された" . $def['name'] . "は既に登録されています");
return array(400, $err_msg);
}
}
// exists ( role_id )
$exist = $roleDao->Retrieve(' company_id = ? AND role_id = ? ', array($company_id, $role_id));
if (empty($exist)) {
$def1 = $this->af->getDef('role_id');
$err_msg = array('role_id' => "入力された" . $def1['name'] . "は登録されていません");
return array(400, $err_msg);
}
// set params
$params = array('login_id' => $login_id, 'user_name' => $user_name, 'e_mail' => $e_mail, 'role_id' => $role_id, 'default_locale' => $default_locale, 'UID' => $s_user_id, 'PGM' => get_class());
// dao update
$userDao->Update($params, ' company_id = ? AND user_id = ? ', array($company_id, $user_id));
// commit
$userDao->CommitTransaction();
} catch (Exception $e) {
// rollback
$userDao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array(500, $e->getMessage());
}
exit;
}
示例6: perform
/**
* ユーザマスタの保存が成功したかJSON形式で返す
* @access public
* @see Admin_ActionClass::perform()
*/
function perform()
{
// get request params
$login_id = $this->af->get('login_id');
$user_name = $this->af->get('user_name');
$warehouse_id = $this->af->get('warehouse_id');
$e_mail = $this->af->get('e_mail');
$pwd_settei = $this->af->get('pwd_settei');
$default_locale = $this->af->get('default_locale');
$raw_user_pwd = Util::makeRandomPassword();
//パスワード生成
$user_pwd = $pwd_settei == 1 ? md5($raw_user_pwd) : '';
// pwd_settei が 1 であれば、ランダムな文字を生成してパスワードとする。
$role_id = $this->af->get('role_id');
// get session params
$company_id = $this->session->get('company_id');
$s_user_id = $this->session->get('user_id');
$kengen_flg = $this->session->get('kengen_flg');
// dao
$userDao = DaoFactory::UserMst();
$roleDao = DaoFactory::RoleMst();
try {
// begin
$userDao->BeginTransaction();
// FIXME: このへんのトランザクション內存在チェック処理、共通化できればもう少しスッキリする… @ 2012/05/01 myoshii@asx.co.jp
// exists ( user_id, login_id )
$wheresql = ' company_id = ? AND login_id = ? ';
$bindarr = array($company_id, $login_id);
$exist = $userDao->Retrieve($wheresql, $bindarr);
if (!empty($exist)) {
$def = $this->af->getDef('login_id');
$err_msg = array('login_id' => "入力された" . $def['name'] . "は既に登録されています");
return array(400, $err_msg);
}
// exists ( role_id )
$exist = $roleDao->Retrieve(' company_id = ? AND role_id = ? ', array($company_id, $role_id));
if (empty($exist)) {
$def1 = $this->af->getDef('role_id');
$err_msg = array('role_id' => "入力された" . $def1['name'] . "は登録されていません");
return array(400, $err_msg);
}
// set params
$params = array('login_id' => $login_id, 'user_name' => $user_name, 'warehouse_id' => $warehouse_id, 'e_mail' => $e_mail, 'kengen_flg' => $kengen_flg, 'user_pwd' => $user_pwd, 'company_id' => $company_id, 'role_id' => $role_id, 'default_locale' => $default_locale, 'upd_uid' => $s_user_id, 'crt_uid' => $s_user_id, 'upd_pgm' => get_class(), 'crt_pgm' => get_class());
// dao insert
$userDao->UserMst_Insert($params);
// commit
$userDao->CommitTransaction();
if ($pwd_settei == 1) {
$params = array('login_id' => $login_id, 'user_name' => $user_name, 'email' => $e_mail, 'user_pwd' => $raw_user_pwd, 'url' => $this->config->get('url'), 'current_locale' => $default_locale);
Util::sendPasswordMail($params);
}
} catch (Exception $e) {
$userDao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array(500, $e->getMessage());
}
exit;
}
示例7: authenticate
function authenticate()
{
$this->af->setApp('app_name', $this->config->get('app_name'));
// ログインチェック
$login = new LoginController();
if (!$login->isLogin()) {
return 'login';
}
// パスワード期限チェック
$company_id = $this->session->get('company_id');
$user_id = $this->session->get('user_id');
$params = array('company_id' => $company_id, 'user_id' => $user_id);
if (DaoFactory::UserMst()->isExpiredPassword($params)) {
return 'password_list';
}
// get params
$action = $this->backend->ctl->getCurrentActionName();
// アクション名を取得
$kengen_flg = intval($this->session->get('kengen_flg'));
// 権限取得
$company_id = $this->session->get('company_id');
// 會社CD取得
$role_id = $this->session->get('role_id');
// ロールID取得
// 権限フラグチェック
if ($kengen_flg != Konst::KENGEN_FLG_KANRI && $kengen_flg != Konst::KENGEN_FLG_SUPER) {
// 管理者ユーザ(8)、スーパーユーザ(9)以外であれば弾く
$login->Logout();
return 'login';
}
// スーパーユーザはロール権限のチェックを行わない
if ($kengen_flg != Konst::KENGEN_FLG_SUPER) {
// ロールD と ActionName を比較して有効であれば通す
$params = array('company_id' => $company_id, 'role_id' => $role_id, 'action_name' => $action);
$enable = DaoFactory::MenuRoleD()->getCheckEnableRole($params)->fetch();
if (empty($enable)) {
return array('redirect', '?action_error=true');
}
}
// パンくず
// アクション名からメニューを取得
$params = array('company_id' => $company_id, 'action_name' => $action);
$current = DaoFactory::MenuRoleD()->getMenuByActionName($params)->fetch();
// 取得したメニューから親メニューを取得
$params = array('company_id' => $company_id, 'menu_id' => $current['PARENT_ID']);
$parent = DaoFactory::MenuRoleD()->getParentMenuByMenuId($params)->fetch();
$this->af->setApp('crumbs_root', array_change_key_case((array) $parent));
$this->af->setApp('crumbs_parent', array_change_key_case((array) $current));
$locale = $this->session->get('current_locale');
if ($locale) {
$this->backend->getController()->setLocale($locale);
}
$this->setGuideModal();
$this->checkLicense();
return null;
}
示例8: check_mail_not_exists
/**
* ログインIDがDBに登録されているかチェックする
* @param string $name フォーム名
*/
public function check_mail_not_exists($name)
{
$bind = array('mail' => $this->form_vars['mail']);
// ログインIDを取得
$dao = DaoFactory::UserMst();
$result = $dao->Retrieve(' E_MAIL = ? ', $bind);
if (empty($result)) {
$this->ae->add($name, "入力された{form}が登録されていません", E_FORM_INVALIDCHAR);
}
}
示例9: check_login_id_is_update
/**
* リクエストのログインIDがUpdate可能であることをチェックする。
* @param string $name フォーム名
*/
public function check_login_id_is_update($name)
{
// ユーザID、ログインIDを取得
$params = array('company_id' => $this->backend->getSession()->get('company_id'), 'user_id' => $this->form_vars['user_id'], 'login_id' => $this->form_vars['login_id']);
// リクエストした user_id 以外で login_id が存在する場合ことを確認
$user = DaoFactory::UserMst()->Retrieve(' company_id = ? AND user_id != ? AND login_id = ? ', $params);
// login_id が存在する場合
if (!empty($user)) {
$this->ae->add($name, "入力された{form}は既に登録されています", E_FORM_INVALIDCHAR);
}
}
示例10: perform
/**
*
* @see Ethna_ActionClass::perform()
*/
function perform()
{
$days = $this->config->get('license_warning_days');
try {
$licenseDao = DaoFactory::LicenseMst();
$userDao = DaoFactory::UserMst();
$companyDao = DaoFactory::CompanyMst();
sort($days, SORT_NUMERIC);
$result = array();
foreach ($days as $day) {
$params = array('day' => $day);
$res = $licenseDao->LicenseMST_GetLicenseValidDays($params)->fetchAll(PDO::FETCH_ASSOC);
$result = array_merge($result, $res);
}
foreach ($result as $value) {
$send_email[$value['COMPANY_ID']][] = array('TERMINAL_ID' => $value['TERMINAL_ID'], 'END_YMD' => $value['END_YMD']);
}
//send e-mail
$headers = "From: {$this->config->get('admin_email_address')}";
foreach ($send_email as $company => $arr) {
$invalid_terminal_list = '';
foreach ($arr as $key => $value) {
$invalid_terminal_list .= "\n{$value['TERMINAL_ID']}\t\t\t{$value['END_YMD']}";
}
//get admin user's e-mail address and language
$companyInfo = $companyDao->Retrieve('COMPANY_ID = ?', array($company));
//$companyInfo['CONTACT']
$userInfo = $userDao->Retrieve("LOGIN_ID = 'admin' AND COMPANY_ID = ? ", array($company));
//$userInfo['E_MAIL']
//$userInfo['DEFAULT_LOCALE'] zh-Hans-CN en_US ja_JP
if ($userInfo['DEFAULT_LOCALE'] == 'zh-Hans-CN') {
$this->backend->getController()->setLocale('zh-Hans-CN');
$subject = _et($this->config->get('system_name')) . "終端證書即將到期";
$send_message = "\n{$companyInfo['COMPANY_NAME']} \n{$companyInfo['CONTACT']} 您好!\n \t\n非常感謝您使用我們的{$this->config->get('app_name')}服務。\n您的以下終端的證書即將過期,為了不影響業務請盡快到證書管理頁麵購買新的證書。\n\n終端\t\t\t到期日\n" . $invalid_terminal_list . "\n\n新的證書可以從後台管理係統的證書管理頁麵購買,也可以直接到AsShop購買。\n如有任何問題請隨即和我們取得聯係。\n\n服務總站 http://www.asx4.net\nAsWiki\t\thttps://wiki.asx4.net\nAsHelp \thttps://support.asx4.net\nAsShop\thttps://ec.asx4.net\n \t\n";
} elseif ($userInfo['DEFAULT_LOCALE'] == 'ja_JP') {
$this->backend->getController()->setLocale('ja_JP');
$subject = _et($this->config->get('system_name')) . "端末のライセンスの期限が近づいています";
$send_message = "\n{$companyInfo['COMPANY_NAME']} \n{$companyInfo['CONTACT']} 様\n \t\n{$this->config->get('app_name')}をご利用いただきまして誠にありがとうございます。\n下記の端末のライセンスの期限が近づいています。業務に影響を與えないように早めに新しいライセンスをご購入ください。\n\n端末ID\t\t\t期限\n" . $invalid_terminal_list . "\n\nライセンスは管理畫麵のライセンスマスタ畫麵か、AsShopからご購入いただけます。\nご不明な點がございましたら、お問い合わせください。\n\nサービスホーム http://www.asx4.net\nAsWiki \t\t\t\thttps://wiki.asx4.net\nAsHelp \t\t\t\thttps://support.asx4.net\nAsShop \t\t\t\thttps://ec.asx4.net \n \t\n";
} else {
$this->backend->getController()->setLocale('en_US');
$subject = _et($this->config->get('system_name')) . " Terminal will be out of license soon";
$send_message = "\n{$companyInfo['COMPANY_NAME']} \nHi {$companyInfo['CONTACT']}\n \t\nThanks for using our {$this->config->get('app_name')} service. \nThe following terminal will be out of license soon. Please buy new license as soon as possible.\n\nTerminal ID\t\t\tValid Until\n" . $invalid_terminal_list . "\n\nYou can buy new licenses from the LICENSE MANAGEMENT page in our admin system or buy form the AsShop directly.\nIf you have any question, please don't hesitate to contact us.\n\nService Home\t\thttp://www.asx4.net\nAsWiki \t\t\thttps://wiki.asx4.net\nAsHelp \t\t\thttps://support.asx4.net\nAsShop \t\t\thttps://ec.asx4.net\n";
}
mb_send_mail($userInfo['E_MAIL'], $subject, $send_message, $headers);
}
} catch (Exception $e) {
$this->logger->log(LOG_ERR, $e->getMessage());
die($e->getMessage());
}
}
示例11: _setDefault
public function _setDefault(&$renderer)
{
// get session params
$company_id = $this->session->get('company_id');
$user_id = $this->session->get('user_id');
$kengen_flg = $this->session->get('kengen_flg');
// su?
if ($kengen_flg == Konst::KENGEN_FLG_SUPER) {
// get menu mst
$top_menu = DaoFactory::MenuMst()->Select(' company_id = ? and parent_id is null ORDER BY MENU_ID ', array('company_id' => $company_id))->fetchAll();
// get menu
$global_menu = array();
foreach ($top_menu as $menu) {
$params = array('company_id' => $company_id, 'parent_id' => $menu['MENU_ID']);
$child_menu = DaoFactory::MenuMst()->Select(' company_id = ? AND parent_id = ? ORDER BY MENU_ID ', $params)->fetchAll();
if (!empty($child_menu)) {
$global_menu[$menu['MENU_ID']]['child_menu'] = $child_menu;
$global_menu[$menu['MENU_ID']]['top_menu_name'] = $menu['MENU_NAME'];
}
}
} else {
// get user
$params = array('company_id' => $company_id, 'user_id' => $user_id);
$user = DaoFactory::UserMst()->Retrieve(' company_id = ? and user_id = ? and del_flg = 0 ', $params);
$user_role_id = $user['ROLE_ID'];
// get menu mst
$top_menu = DaoFactory::MenuMst()->Select(' company_id = ? and parent_id is null ORDER BY MENU_ID ', array('company_id' => $company_id))->fetchAll();
// get menu
$global_menu = array();
foreach ($top_menu as $menu) {
$params = array('company_id' => $company_id, 'role_id' => $user_role_id, 'parent_id' => $menu['MENU_ID']);
$child_menu = DaoFactory::MenuRoleD()->getMenuRoleDAtParentIdByRoleIdAndParentId($params)->fetchAll();
if (!empty($child_menu)) {
$global_menu[$menu['MENU_ID']]['child_menu'] = $child_menu;
$global_menu[$menu['MENU_ID']]['top_menu_name'] = $menu['MENU_NAME'];
}
}
}
// Renderer からテンプレートエンジンを取得
$smarty =& $renderer->getEngine();
$smarty->assign('global_menu', $global_menu);
}
示例12: perform
/**
* ユーザのパスワードの再設定が成功したかJSON形式で返す
* @access public
* @see Admin_ActionClass::perform()
*/
function perform()
{
// get request params
$user_id_arr = $this->af->get('user_id_arr');
// get session params
$company_id = $this->session->get('company_id');
$s_user_id = $this->session->get('user_id');
// dao
$userDao = DaoFactory::UserMst();
try {
// begin
$userDao->BeginTransaction();
// exists ( user_id )
foreach ($user_id_arr as $user_id) {
$user_pwd = Util::makeRandomPassword();
$exist = $userDao->Retrieve(' company_id = ? AND user_id = ?', array($company_id, $user_id));
if (empty($exist)) {
$def1 = $this->af->getDef('user_id');
$err_msg = array('user_id' => "入力された" . $def1['name'] . "は登録されていません");
return array(400, $err_msg);
}
// set params
$params = array('user_pwd' => md5($user_pwd), 'company_id' => $company_id, 'user_id' => $user_id, 'upd_uid' => $s_user_id, 'upd_pgm' => get_class());
// dao update
$userDao->UserMst_PwdSaisettei($params);
// get user
$user = $userDao->Retrieve(' company_id = ? AND user_id = ? ', array($company_id, $user_id));
// メールのパラメータをセット
$params = array('login_id' => $user['LOGIN_ID'], 'user_name' => $user['USER_NAME'], 'email' => $user['E_MAIL'], 'user_pwd' => $user_pwd, 'url' => $this->config->get('url'));
// メール送信 FIXME: 送信者が文字化けしている @ 2012/05/01 myoshii@asx.co.jp
Util::sendPasswordMail($params);
}
// commit
$userDao->CommitTransaction();
} catch (Exception $e) {
$userDao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array(500, $e->getMessage());
}
exit;
}
示例13: perform
/**
* ユーザマスタのデータをJSON形式で返す
* @access public
* @return array ユーザマスタ
* @see Admin_ActionClass::perform()
*/
public function perform()
{
// get request params ( search )
$login_id = $this->af->get('login_id');
$user_name = $this->af->get('user_name');
$email = $this->af->get('email');
$misettei = $this->af->get('misettei');
$kigengire = $this->af->get('kigengire');
$locking = $this->af->get('locking');
$role_id = $this->af->get('role_id');
$keyword = $this->af->get('keyword');
// get request params ( pager )
$limit = $this->af->get('limit');
$page = $this->af->get('page');
$order = $this->af->get('order');
$column = $this->af->get('column');
// get session params
$company_id = $this->session->get('company_id');
$kengen_flg = $this->session->get('kengen_flg');
// pager setting
$start_page = ($page - 1) * $limit + 1;
$end_page = ($page - 1) * $limit + $limit;
try {
$params = array('login_id' => $login_id, 'user_name' => $user_name, 'email' => $email, 'kengen' => $kengen_flg, 'misettei' => $misettei, 'kigengire' => $kigengire, 'locking' => $locking, 'role_id' => $role_id, 'keyword' => $keyword, 'order' => $order, 'column' => $column, 'company_id' => $company_id, 'start_page' => $start_page, 'end_page' => $end_page);
// 一覧を取得
$list = DaoFactory::UserMst()->UserMst_GetUser($params)->fetchAll();
// ページ情報を設定
$pager = array('result_page' => $page, 'result_start_num' => $start_page, 'result_end_num' => $end_page, 'result_all_count' => count($list) ? $list[0]['FOUND_ROWS'] : 0, 'result_get_count' => count($list), 'result_limit' => $limit);
// output にセット
$output['totalData'] = array();
$output['listData'] = $list;
$output['pagerData'] = $pager;
} catch (Exception $e) {
// 致命的なエラーが発生
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array('500', $e->getMessage());
}
return array('json', $output);
}
示例14: perform
/**
* 擔當マスタのデータをJSON形式で返す
* @access public
* @return array 擔當マスタのデータを返す
* @see Admin_ActionClass::perform()
*/
public function perform()
{
// 初期化
$company_id = $this->session->get('company_id');
$not_user_id = $this->af->get('not_user_id');
$limit = $this->af->get('limit');
// default 50
$page = $this->af->get('page');
// default 1
$order = $this->af->get('order');
// default asc
$column = $this->af->get('column');
// default shop_cd
$keyword = $this->af->get('keyword');
// pager setting
$start_page = ($page - 1) * $limit + 1;
$end_page = ($page - 1) * $limit + $limit;
$userGroup = DaoFactory::UserMst();
if ($not_user_id != "") {
$not_user_id = explode(',', urldecode($not_user_id));
}
try {
// DAO パラメータ定義
$params = array('company_id' => $company_id, 'not_user_id' => $not_user_id, 'limit' => $limit, 'page' => $page, 'order' => $order, 'column' => $column, 'keyword' => $keyword, 'start_page' => $start_page, 'end_page' => $end_page);
// 一覧を取得
$list = $userGroup->UserMst_GetAll($params)->fetchAll();
// ページ情報を設定
$pager = array('result_page' => $page, 'result_start_num' => $start_page, 'result_end_num' => $end_page, 'result_all_count' => count($list) ? $list[0]['FOUND_ROWS'] : 0, 'result_get_count' => count($list), 'result_limit' => $limit);
// output にセット
$output['totalData'] = array();
$output['listData'] = $list;
$output['pagerData'] = $pager;
} catch (Exception $e) {
// 致命的なエラーが発生
return array('500', $e->getMessage());
}
return array('json', $output);
}
示例15: perform
/**
* パスワードリセットの保存が成功したかJSON形式で返す
* @access public
* @see Admin_ActionClass::perform()
*/
function perform()
{
// get request params
$mail = $this->af->get('mail');
try {
$userDao = DaoFactory::UserMst();
// begin
$userDao->BeginTransaction();
$params = array('mail' => $mail);
$users = DaoFactory::UserMst()->UserMst_GetByEMail($params);
if (!empty($users)) {
$pwd = Util::makeRandomPassword();
//パスワード生成
$user_pwd = md5($pwd);
$params = array('USER_PWD' => $user_pwd, 'PWD_MISMATCH' => '0', 'PWD_UNLOCK' => NULL, 'UID' => $user_id, 'PGM' => get_class());
$userDao->Update($params, " E_MAIL = ? ", array($mail));
// commit
$userDao->CommitTransaction();
$companyarr = array();
$namearr = array();
$idarr = array();
$current_locale = $users[0]['DEFAULT_LOCALE'];
foreach ($users as $someone) {
$companyarr[$someone['COMPANY_ID']] = $someone['COMPANY_ID'];
$namearr[] = $someone['USER_NAME'];
$idarr[] = $someone['LOGIN_ID'];
}
$params = array('company_id' => implode(',', $companyarr), 'login_id' => implode(',', $idarr), 'email' => $mail, 'user_pwd' => $pwd, 'url' => $this->config->get('url'), 'user_name' => implode(',', $namearr), 'current_locale' => $current_locale);
Util::sendPasswordMail($params);
//return 'login';
}
} catch (Exception $e) {
$userDao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array(500, $e->getMessage());
}
exit;
}