function insertMlistData(&$request)
 {
     $this->oDb->begin();
     // ユーザID取得
     $mlist_id = $this->oDb->getSequence('mlist_id_seq');
     // 基本情報
     $args = $this->getSqlArgs();
     $args['MLIST_ID'] = $this->sqlItemInteger($mlist_id);
     $args['MLIST_NAME'] = $this->sqlItemChar($request['mlist_name']);
     $args['MLIST_ACC'] = $this->sqlItemChar($request['mlist_acc']);
     $args['SENDER_KBN'] = $this->sqlItemChar($request['sender_kbn']);
     $args['MLIST_KBN'] = $this->sqlItemChar($request['mlist_kbn']);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $args['USAGE'] = $this->sqlItemChar($request['usage']);
     $sql = $this->getQuery('INSERT_MLIST_HEAD', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     //
     // 管理者データ
     //
     if (is_array($request['admin_id'])) {
         $args = $this->getSqlArgs();
         $args['MLIST_ID'] = $this->sqlItemInteger($mlist_id);
         foreach ($request['admin_id'] as $no => $user_id) {
             $args['LIST_NO'] = $this->sqlItemInteger($no);
             $args['USER_ID'] = $this->sqlItemInteger($user_id);
             $sql = $this->getQuery('INSERT_MLIST_ADMIN', $args);
             $ret = $this->oDb->query($sql);
             if (!$ret) {
                 Debug_Print($sql);
                 $this->oDb->rollback();
                 return false;
             }
             // 管理者ロールを割り当てる
             $ret = $this->setUserAdminRole($user_id, ROLE_ID_MLIST_ADMIN);
             if (!$ret) {
                 Debug_Print($sql);
                 $this->oDb->rollback();
                 return false;
             }
         }
     }
     // 一旦トランザクション終了
     $this->oDb->end();
     //
     // メールアカウント連携
     //
     if ($request['mlist_acc'] != "") {
         $this->addMailingList($request);
     }
     $request['mlist_id'] = $mlist_id;
     return true;
 }
 function insertVpnData(&$request)
 {
     $this->oDb->begin();
     // ユーザID取得
     $vpn_id = $this->oDb->getSequence('vpn_id_seq');
     // 基本情報
     $args = $this->getSqlArgs();
     $args['VPN_ID'] = $this->sqlItemInteger($vpn_id);
     $args['VPN_KBN'] = $this->sqlItemChar($request['vpn_kbn']);
     $args['VPN_NAME'] = $this->sqlItemChar($request['vpn_name']);
     $args['GROUP_NAME'] = $this->sqlItemChar($request['group_name']);
     $args['GROUP_CODE'] = $this->sqlItemChar($request['group_code']);
     $args['USAGE'] = $this->sqlItemChar($request['usage']);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $sql = $this->getQuery('INSERT_VPN_HEAD', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     //
     // 管理者データ
     //
     if (is_array($request['admin_id'])) {
         $args = $this->getSqlArgs();
         $args['VPN_ID'] = $this->sqlItemInteger($vpn_id);
         foreach ($request['admin_id'] as $no => $user_id) {
             $args['LIST_NO'] = $this->sqlItemInteger($no);
             $args['USER_ID'] = $this->sqlItemInteger($user_id);
             $sql = $this->getQuery('INSERT_VPN_ADMIN', $args);
             $ret = $this->oDb->query($sql);
             if (!$ret) {
                 Debug_Print($sql);
                 $this->oDb->rollback();
                 return false;
             }
             // 管理者ロールを割り当てる
             $ret = $this->setUserAdminRole($user_id, ROLE_ID_VPN_ADMIN);
             if (!$ret) {
                 Debug_Print($sql);
                 $this->oDb->rollback();
                 return false;
             }
         }
     }
     // トランザクション終了
     $this->oDb->end();
     // AD連携はなし←登録済みのはず
     $request['vpn_id'] = $vpn_id;
     return true;
 }
 function changeSbcFlg($request)
 {
     $args = $this->getSqlArgs();
     $args['APP_ID'] = $this->sqlItemInteger($request['app_id']);
     $args['USE_SBC'] = $this->sqlItemFlg(@$request['use_sbc']);
     $sql = $this->getQuery('UPDATE_APP_USE_SBC', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
 function cancelMlistEntry($mlist_id, $entry_no)
 {
     $args = $this->getSqlArgs();
     $args[0] = $mlist_id;
     $args[1] = $entry_no;
     $args['ENTRY_STATUS'] = $this->sqlItemChar(ENTRY_STATUS_CANCEL);
     $sql = $this->getQuery('CANCEL_MLIST_HEAD_ENTRY', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
 function deleteData($request)
 {
     $vlan_id = $request['vlan_id'];
     $user_id = $request['list_no'];
     // 削除
     $args = $this->getSqlArgs();
     $args[0] = $vlan_id;
     $args[1] = $user_id;
     $sql = $this->getQuery('DELETE_DATA', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
 function insertGuestData(&$request)
 {
     $request['mac_addr'] = $this->getFlatMacAddr($request['mac_addr']);
     $request['wireless_id'] = microtime(true);
     $request['password'] = $this->createPassword();
     $user_id = $this->getSessionData('LOGIN_USER_ID');
     $password = $this->passwordEncrypt($request['password']);
     $this->oDb->begin();
     // ユーザID取得
     $guest_id = $this->oDb->getSequence('guest_id_seq');
     // 基本情報
     $args = $this->getSqlArgs();
     $args['GUEST_ID'] = $this->sqlItemInteger($guest_id);
     $args['GUEST_NAME'] = $this->sqlItemChar($request['guest_name']);
     $args['COMPANY_NAME'] = $this->sqlItemChar($request['company_name']);
     $args['BELONG_NAME'] = $this->sqlItemChar($request['belong_name']);
     $args['TELNO'] = $this->sqlItemChar($request['telno']);
     $args['MAC_ADDR'] = $this->sqlItemChar($request['mac_addr']);
     $args['WIRELESS_ID'] = $this->sqlItemChar($request['wireless_id']);
     $args['PASSWORD'] = $this->sqlItemChar($password);
     $args['USAGE'] = $this->sqlItemChar($request['usage']);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $sql = $this->getQuery('INSERT_GUEST_HEAD', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     // エントリーテーブルを更新
     $ret = $this->updateUserEntryFlg($user_id, 'guest_entry_flg');
     if (!$ret) {
         $this->oDb->rollback();
         return false;
     }
     // トランザクション終了
     $this->oDb->end();
     // AD連携
     $this->relationAd($request);
     $request['guest_id'] = $guest_id;
     return true;
 }
 function deleteGuestData($guest_id)
 {
     // 削除する前にデータを取得
     $aryGuest = $this->getGuestData($guest_id);
     //$mac_addr = $aryGuest['mac_addr'];
     $wireless_id = $aryGuest['wireless_id'];
     // 基本情報
     $args = $this->getSqlArgs();
     $args[0] = $guest_id;
     $sql = $this->getQuery('DELETE_GUEST_HEAD', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     // 同期
     $this->deleteAd($wireless_id);
     return true;
 }
 function updateVpnMembersData(&$request)
 {
     $vpn_id = $request['vpn_id'];
     $vpn_user_id = $request['vpn_user_id'];
     // パスワード暗号化
     $passwd = $this->passwordEncrypt($request['passwd']);
     // 更新前にDBデータを取得し比較
     $aryTmp = $this->getVpnMembersData($request['vpn_id'], $request['vpn_user_id']);
     $aryTmp['passwd'] = $this->passwordDecrypt($aryTmp['passwd']);
     $this->oDb->begin();
     $args = $this->getSqlArgs();
     $args['VPN_ID'] = $this->sqlItemInteger($vpn_id);
     $args['VPN_USER_ID'] = $this->sqlItemChar($vpn_user_id);
     $args['MAIL_ADDR'] = $this->sqlItemChar($request['mail_addr']);
     $args['PASSWD'] = $this->sqlItemChar($passwd);
     $args['KANJINAME'] = $this->sqlItemChar($request['kanjiname']);
     $args['KANANAME'] = $this->sqlItemChar($request['kananame']);
     $args['COMPANY'] = $this->sqlItemChar($request['company']);
     $args['CONTACT'] = $this->sqlItemChar($request['contact']);
     $args['EXPIRY_DATE'] = $this->sqlItemChar($request['expiry_date']);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $sql = $this->getQuery('UPDATE_VPN_MEMBERS_LIST', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     // 有効期限・メールアドレス・パスワードの何れかが変更されたらAD連携する
     if ($aryTmp['expiry_date'] != $request['expiry_date'] || $aryTmp['mail_addr'] != $request['mail_addr'] || $aryTmp['passwd'] != $request['passwd']) {
         // AD連携
         if ($aryTmp['vpn_kbn'] == VPN_KBN_VPN) {
             $this->modifyVpnMembers($request);
         } else {
             $this->modifyPasslogicMembers($request);
         }
     }
     return true;
 }
 function rejectAppEntry($request)
 {
     $app_id = $request['app_id'];
     $entry_no = $request['entry_no'];
     $agree_note = $request['agree_note'];
     // 申請内容によって処理わけ
     $aryEnt = $this->getAppHead($app_id, $entry_no);
     $entry_kbn = $aryEnt['entry_kbn'];
     $entry_id = $aryEnt['entry_id'];
     $args = $this->getSqlArgs();
     $args[0] = $app_id;
     $args[1] = $entry_no;
     $args['AGREE_NOTE'] = $this->sqlItemChar($agree_note);
     $args['ENTRY_STATUS'] = $this->sqlItemChar(ENTRY_STATUS_REJECT);
     $sql = $this->getQuery('REJECT_APP_HEAD_ENTRY', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     // メール送信
     $this->sendRejectMail($entry_id, $entry_kbn);
     return true;
 }
 function makeEditLog($user_id, $log_kbn, $mode_name = "", $reserve_flg = "0", $reflect_date = "")
 {
     //
     return true;
     $log_user_id = $this->getSessionData('LOGIN_USER_ID');
     $ctrl_id = "";
     if ($mode_name != "") {
         $ctrl_id = $this->getCtrlId($mode_name);
     }
     $args = array();
     $args['USER_ID'] = $this->sqlItemInteger($user_id);
     $args['LOG_KBN'] = $this->sqlItemChar($log_kbn);
     $args['CTRL_ID'] = $this->sqlItemInteger($ctrl_id);
     $args['LOG_USER_ID'] = $this->sqlItemInteger($log_user_id);
     $args['RESERVE_FLG'] = $this->sqlItemFlg($reserve_flg);
     $args['REFLECT_DATE'] = $this->sqlItemChar($reflect_date);
     $sql = $this->getQuery("INSERT_EDIT_LOG", $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
 function updateVpnData($request)
 {
     // ID
     $vpn_id = $request['vpn_id'];
     $aryOld = $this->getVpnData($vpn_id);
     $this->oDb->begin();
     // 基本情報
     $args = $this->getSqlArgs();
     $args['VPN_ID'] = $this->sqlItemInteger($vpn_id);
     $args['VPN_KBN'] = $this->sqlItemChar($request['vpn_kbn']);
     $args['VPN_NAME'] = $this->sqlItemChar($request['vpn_name']);
     $args['GROUP_NAME'] = $this->sqlItemChar($request['group_name']);
     $args['GROUP_CODE'] = $this->sqlItemChar($request['group_code']);
     $args['USAGE'] = $this->sqlItemChar($request['usage']);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $sql = $this->getQuery('UPDATE_VPN_HEAD', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     //
     // 管理者データ
     //
     // 一旦論理削除
     $args = $this->getSqlArgs();
     $args['VPN_ID'] = $this->sqlItemInteger($vpn_id);
     $args['USER_ID'] = $this->sqlItemInteger($user_id);
     $sql = $this->getQuery('DELETE_VPN_ADMIN_DATA', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     if (is_array($request['admin_id'])) {
         $args = $this->getSqlArgs();
         $args['VPN_ID'] = $this->sqlItemInteger($vpn_id);
         foreach ($request['admin_id'] as $no => $user_id) {
             $args['LIST_NO'] = $this->sqlItemInteger($no);
             $args['USER_ID'] = $this->sqlItemInteger($user_id);
             // 存在チェック
             $sql = $this->getQuery('EXISTS_VPN_ADMIN', $args);
             $list_no = $this->oDb->getOne($sql);
             if ($list_no == "") {
                 $sql_id = "INSERT_VPN_ADMIN";
             } else {
                 $sql_id = "UPDATE_VPN_ADMIN";
             }
             $sql = $this->getQuery($sql_id, $args);
             $ret = $this->oDb->query($sql);
             if (!$ret) {
                 Debug_Print($sql);
                 $this->oDb->rollback();
                 return false;
             }
             // 管理者ロールを割り当てる
             $ret = $this->setUserAdminRole($user_id, ROLE_ID_VPN_ADMIN);
             if (!$ret) {
                 Debug_Print($sql);
                 $this->oDb->rollback();
                 return false;
             }
         }
     }
     // 一旦トランザクション終了
     $this->oDb->end();
     return true;
 }
 function insertUserHisData($user_id, &$request, $no = "", $key = "")
 {
     if ($key == "") {
         $no = "0";
         $send_date = $request['send_date'];
         $staffcode = $request['staffcode'];
         $kanjiname = $request['kanjiname'];
         $kananame = $request['kananame'];
         $password = $request['password'];
         $wardcode = $request['wardcode'];
         $professioncode = $request['professioncode'];
         $gradecode = $request['gradecode'];
         $appcode = $request['appcode'];
         $deptcode = $request['deptcode'];
         $deptgroupcode = $request['deptgroupcode'];
         $validstartdate = $request['validstartdate'];
         $validenddate = $request['validenddate'];
     } else {
         $send_date = $request['sub_send_date'][$key];
         $staffcode = $request['sub_staffcode'][$key];
         $kanjiname = $request['sub_kanjiname'][$key];
         $kananame = $request['sub_kananame'][$key];
         $password = $request['sub_password'][$key];
         $wardcode = $request['sub_wardcode'][$key];
         $professioncode = $request['sub_professioncode'][$key];
         $gradecode = $request['sub_gradecode'][$key];
         $appcode = $request['sub_appcode'][$key];
         $deptcode = $request['sub_deptcode'][$key];
         $deptgroupcode = $request['sub_deptgroupcode'][$key];
         $validstartdate = $request['sub_validstartdate'][$key];
         $validenddate = $request['sub_validenddate'][$key];
     }
     $password = $this->passwordEncrypt($password);
     list($start_y, $start_m, $start_d) = explode("/", $validstartdate);
     $validstartdate = sprintf("%04d-%02d-%02d", $start_y, $start_m, $start_d);
     list($end_y, $end_m, $end_d) = explode("/", $validenddate);
     $validenddate = sprintf("%04d-%02d-%02d", $end_y, $end_m, $end_d);
     list($send_y, $send_m, $send_d) = explode("/", $send_date);
     $send_date = sprintf("%04d-%02d-%02d", $send_y, $send_m, $send_d);
     $args = $this->getSqlArgs();
     $args['USER_ID'] = $this->sqlItemInteger($user_id);
     $args['LIST_NO'] = $this->sqlItemInteger($no);
     $args['STAFFCODE'] = $this->sqlItemChar($staffcode);
     $args['WARDCODE'] = $this->sqlItemChar($wardcode);
     $args['PROFESSIONCODE'] = $this->sqlItemChar($professioncode);
     $args['GRADECODE'] = $this->sqlItemChar($gradecode);
     $args['KANANAME'] = $this->sqlItemChar($kananame);
     $args['KANJINAME'] = $this->sqlItemChar($kanjiname);
     $args['PASSWORD'] = $this->sqlItemChar($password);
     $args['VALIDSTARTDATE'] = $this->sqlItemChar($validstartdate);
     $args['VALIDENDDATE'] = $this->sqlItemChar($validenddate);
     $args['DEPTCODE'] = $this->sqlItemChar($deptcode);
     $args['APPCODE'] = $this->sqlItemChar($appcode);
     $args['DEPTGROUPCODE'] = $this->sqlItemChar($deptgroupcode);
     $args['SEND_DATE'] = $this->sqlItemChar($send_date);
     $sql = $this->getQuery('INSERT_USER_HIS', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
 function updateMlistData($request)
 {
     // ID
     $mlist_id = $request['mlist_id'];
     $aryOld = $this->getMlistData($mlist_id);
     $this->oDb->begin();
     // 基本情報
     $args = $this->getSqlArgs();
     $args['MLIST_ID'] = $this->sqlItemInteger($mlist_id);
     $args['MLIST_NAME'] = $this->sqlItemChar($request['mlist_name']);
     $args['MLIST_ACC'] = $this->sqlItemChar($request['mlist_acc']);
     $args['SENDER_KBN'] = $this->sqlItemChar($request['sender_kbn']);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $args['USAGE'] = $this->sqlItemChar($request['usage']);
     $sql = $this->getQuery('UPDATE_MLIST_HEAD', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     //
     // 管理者データ
     //
     // 一旦論理削除
     $args = $this->getSqlArgs();
     $args['MLIST_ID'] = $mlist_id;
     $sql = $this->getQuery('DELETE_MLIST_ADMIN_DATA', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     if (is_array($request['admin_id'])) {
         $args = $this->getSqlArgs();
         $args['MLIST_ID'] = $this->sqlItemInteger($mlist_id);
         foreach ($request['admin_id'] as $no => $user_id) {
             $args['LIST_NO'] = $this->sqlItemInteger($no);
             $args['USER_ID'] = $this->sqlItemInteger($user_id);
             // 存在チェック
             $sql = $this->getQuery('EXISTS_MLIST_ADMIN', $args);
             $ex_sql = $sql;
             $list_no = $this->oDb->getOne($sql);
             if ($list_no == "") {
                 $sql_id = "INSERT_MLIST_ADMIN";
             } else {
                 $sql_id = "UPDATE_MLIST_ADMIN";
             }
             $sql = $this->getQuery($sql_id, $args);
             $ret = $this->oDb->query($sql);
             if (!$ret) {
                 Debug_Print($sql . $ex_sql);
                 $this->oDb->rollback();
                 return false;
             }
             // 管理者ロールを割り当てる
             $ret = $this->setUserAdminRole($user_id, ROLE_ID_MLIST_ADMIN);
             if (!$ret) {
                 Debug_Print($sql);
                 $this->oDb->rollback();
                 return false;
             }
         }
     }
     // 一旦トランザクション終了
     $this->oDb->end();
     //
     // メールアカウント連携
     //
     if ($aryOld['mlist_acc'] != $request['mlist_acc']) {
         // アカウントが変わった場合
         $this->editMailingList($aryOld['mlist_acc'], $request['mlist_acc']);
     }
     // 送信者制限が変わった場合
     if ($aryOld['sender_kbn'] != $request['sender_kbn']) {
         $this->editSenderKbn($request);
     }
     return true;
 }
Esempio n. 14
0
 function deleteData($request)
 {
     // トランザクション開始
     $this->oDb->begin();
     $vlan_id = $request['vlan_id'];
     // 削除
     $args = $this->getSqlArgs();
     $args[0] = $vlan_id;
     $sql = $this->getQuery('DELETE_DATA', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $sql = $this->getQuery('DELETE_ADMIN_DATA', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     // トランザクション終了
     $this->oDb->end();
     return true;
 }
 function deleteMlistData($mlist_id)
 {
     $this->oDb->begin();
     // 基本情報
     $args = $this->getSqlArgs();
     $args[0] = $mlist_id;
     $sql = $this->getQuery('DELETE_MLIST_HEAD', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $sql = $this->getQuery('DELETE_MLIST_ADMIN', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $sql = $this->getQuery('DELETE_MLIST_MEMBERS', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     // 同期
     $this->delMailingList($mlist_id);
     return true;
 }
 function updateAppData(&$request)
 {
     $app_id = $request['app_id'];
     $request['mac_addr'] = $this->getFlatMacAddr($request['mac_addr']);
     $aryOrg = $this->getAppHead($app_id);
     $this->oDb->begin();
     $args = $this->getSqlArgs();
     $args['APP_ID'] = $this->sqlItemInteger($app_id);
     $args['APP_TYPE_ID'] = $this->sqlItemInteger($request['app_type_id']);
     $args['APP_NAME'] = $this->sqlItemChar($request['app_name']);
     $args['VLAN_ROOM_ID'] = $this->sqlItemInteger($request['vlan_room_id']);
     $args['VLAN_ID'] = $this->sqlItemInteger(@$request['vlan_id']);
     $args['MAC_ADDR'] = $this->sqlItemChar($request['mac_addr']);
     $args['IP_ADDR'] = $this->sqlItemChar($request['ip_addr']);
     $args['WIRE_KBN'] = $this->sqlItemChar(@$request['wire_kbn']);
     $args['IP_KBN'] = $this->sqlItemChar(@$request['ip_kbn']);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $args['APP_USER_ID'] = $this->sqlItemInteger($request['app_user_id']);
     $args['USE_SBC'] = $this->sqlItemFlg(@$request['use_sbc']);
     $sql = $this->getQuery('UPDATE_APP_HEAD_TBL', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     // 区分別にチェック
     list($wire_kbn, $ip_kbn) = $this->getAppTypeKbns($request['app_type_id']);
     if ($wire_kbn == WIRE_KBN_FREE) {
         $wire_kbn = $request['wire_kbn'];
     }
     $aryOrgList = array();
     $aryList = array();
     if ($wire_kbn == WIRE_KBN_WLESS) {
         $aryOrgList = $this->getAppList($app_id);
         $aryOrgListSrc = $this->getAppList($app_id);
         $aryVlan = $this->getTempVlanList();
         if (is_array($aryVlan)) {
             foreach ($aryVlan as $vlan_id => $data) {
                 $aryList[$vlan_id] = $data;
                 if (isset($aryOrgList[$vlan_id])) {
                     // 内容に差異がないか確認
                     $is_changed = false;
                     if ($aryOrgList[$vlan_id]['busy_flg'] != $data['busy_flg']) {
                         $is_changed = true;
                     }
                     // 処理するので消しておく
                     unset($aryOrgList[$vlan_id]);
                     // 変わってなければスキップ
                     if (!$is_changed) {
                         continue;
                     }
                 }
                 $args = $this->getSqlArgs();
                 $args['APP_ID'] = $this->sqlItemInteger($app_id);
                 $args['VLAN_ID'] = $this->sqlItemInteger($vlan_id);
                 $args['BUSY_FLG'] = $this->sqlItemFlg($data['busy_flg']);
                 // 存在チェック
                 $sql = $this->getQuery('EXISTS_APP_LIST_TBL', $args);
                 $ext_id = $this->oDb->getOne($sql);
                 if ($ext_id != "") {
                     $sql_id = 'UPDATE_APP_LIST_TBL';
                 } else {
                     $sql_id = 'INSERT_APP_LIST_TBL';
                 }
                 $sql = $this->getQuery($sql_id, $args);
                 $ret = $this->oDb->query($sql);
                 if (!$ret) {
                     Debug_Print($sql);
                     return false;
                 }
             }
             // 残ってたら消す
             if (is_array($aryOrgList)) {
                 foreach ($aryOrgList as $vlan_id => $data) {
                     $args = $this->getSqlArgs();
                     $args['APP_ID'] = $this->sqlItemInteger($app_id);
                     $args['VLAN_ID'] = $this->sqlItemInteger($vlan_id);
                     $sql = $this->getQuery('DELETE_APP_LIST_TBL', $args);
                     $ret = $this->oDb->query($sql);
                     if (!$ret) {
                         Debug_Print($sql);
                         return false;
                     }
                 }
             }
         }
     }
     $make_wireless_id = false;
     if ($wire_kbn == WIRE_KBN_WLESS) {
         // 無線IDチェック
         $wid = $this->getUserWirelessId($request['app_user_id']);
         if ($wid == "") {
             $this->makeWirelessId($request['app_user_id']);
             if (!$ret) {
                 $this->oDb->rollback();
                 return false;
             }
             $make_wireless_id = true;
         }
     }
     // エントリーテーブルを更新
     $ret = $this->updateUserEntryFlg($request['app_user_id'], 'app_entry_flg');
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     $this->clearTempVlanList();
     // AD連携
     $ret = $this->relationAd($wire_kbn, $aryOrg, $request, $aryOrgListSrc, $aryList, $make_wireless_id);
     if (!$ret) {
         $this->makeAppAdErrLog($app_id);
     }
     return true;
 }
 function insertAppData(&$request)
 {
     $user_id = $this->getSessionData('LOGIN_USER_ID');
     $mac_addr = $this->getFlatMacAddr($request['mac_addr']);
     $this->oDb->begin();
     if (isset($request['unknown_data'])) {
         $request['app_id'] = $request['unknown_data']['app_id'];
     }
     $id_addr = "";
     $wireless_id = "";
     if (@$request['app_id'] != "") {
         $app_id = $request['app_id'];
         $entry_kbn = ENTRY_KBN_EDIT;
         $aryOrg = $this->getAppHead($app_id);
         if ($aryOrg['app_id'] == "") {
             // 登録却下の再申請の場合
             $entry_kbn = ENTRY_KBN_ADD;
         } else {
             $ip_addr = $aryOrg['ip_addr'];
             $wireless_id = $aryOrg['wireless_id'];
         }
     } else {
         $app_id = $this->oDb->getSequence("app_id_seq");
         $entry_kbn = ENTRY_KBN_ADD;
     }
     // 区分別にチェック
     list($wire_kbn, $ip_kbn) = $this->getAppTypeKbns($request['app_type_id']);
     if ($wire_kbn == WIRE_KBN_FREE) {
         $wire_kbn = $request['wire_kbn'];
     }
     if ($wire_kbn == WIRE_KBN_WLESS) {
         $wireless_id = @$aryOrg['wireless_id'];
         if ($wireless_id == "") {
             $aryUser = $this->getUserData($user_id);
             $login_id = $aryUser['login_id'];
             $wireless_id = $this->createWirelessId($login_id);
         }
     }
     // 申請番号取得(ロック)
     $sql = $this->getQuery('ENTRY_LOCK', $args);
     $this->oDb->query($sql);
     $sql = $this->getQuery('GET_ENTRY_NO', $app_id);
     $entry_no = $this->oDb->getOne($sql);
     $args = $this->getSqlArgs();
     $args['APP_ID'] = $this->sqlItemInteger($app_id);
     $args['ENTRY_NO'] = $this->sqlItemInteger($entry_no);
     $args['ENTRY_STATUS'] = $this->sqlItemChar(ENTRY_STATUS_ENTRY);
     $args['ENTRY_KBN'] = $this->sqlItemChar($entry_kbn);
     $args['APP_TYPE_ID'] = $this->sqlItemInteger($request['app_type_id']);
     $args['APP_NAME'] = $this->sqlItemChar($request['app_name']);
     $args['VLAN_ROOM_ID'] = $this->sqlItemInteger($request['vlan_room_id']);
     $args['VLAN_ID'] = $this->sqlItemInteger(@$request['vlan_id']);
     $args['MAC_ADDR'] = $this->sqlItemChar($mac_addr);
     $args['IP_ADDR'] = $this->sqlItemChar($ip_addr);
     $args['WIRE_KBN'] = $this->sqlItemChar(@$request['wire_kbn']);
     $args['IP_KBN'] = $this->sqlItemChar(@$request['ip_kbn']);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $args['ENTRY_ID'] = $this->sqlItemInteger($user_id);
     $args['WIRELESS_ID'] = $this->sqlItemChar($wireless_id);
     $args['USE_SBC'] = $this->sqlItemFlg(@$aryOrg['use_sbc']);
     $sql = $this->getQuery('INSERT_APP_HEAD_ENTRY', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     // 申請対象VLANを保持
     $target_vlan_id = $request['vlan_id'];
     if ($wire_kbn == WIRE_KBN_WLESS) {
         // 承認済みのデータをコピー
         $aryVlan = $this->getTempVlanList();
         if (is_array($aryVlan)) {
             $args = $this->getSqlArgs();
             $args['APP_ID'] = $this->sqlItemInteger($app_id);
             $args['ENTRY_NO'] = $this->sqlItemInteger($entry_no);
             foreach ($aryVlan as $vlan_id => $data) {
                 $args['VLAN_ID'] = $this->sqlItemInteger($vlan_id);
                 $args['ENTRY_ID'] = $this->sqlItemInteger($user_id);
                 $args['BUSY_FLG'] = $this->sqlItemFlg($data['busy_flg']);
                 $sql = $this->getQuery('INSERT_APP_LIST_ENTRY_SAVE', $args);
                 $ret = $this->oDb->query($sql);
                 if (!$ret) {
                     Debug_Print($sql);
                     $this->oDb->rollback();
                     return false;
                 }
             }
         }
         // VLANの追加があれば登録
         if ($request['wl_vlan_id'] != "") {
             $args = $this->getSqlArgs();
             $args['APP_ID'] = $this->sqlItemInteger($app_id);
             $args['ENTRY_NO'] = $this->sqlItemInteger($entry_no);
             $args['VLAN_ID'] = $this->sqlItemInteger($request['wl_vlan_id']);
             $args['ENTRY_ID'] = $this->sqlItemInteger($user_id);
             $busy_flg = '0';
             if (count($aryVlan) == 0) {
                 $busy_flg = '1';
             }
             $args['BUSY_FLG'] = $this->sqlItemFlg($busy_flg);
             $sql = $this->getQuery('INSERT_APP_LIST_ENTRY', $args);
             $ret = $this->oDb->query($sql);
             if (!$ret) {
                 Debug_Print($sql);
                 $this->oDb->rollback();
                 return false;
             }
             // 申請対象VLAN
             $target_vlan_id = $request['wl_vlan_id'];
         }
     }
     // エントリーテーブルを更新
     $ret = $this->updateUserEntryFlg($user_id, 'app_entry_flg');
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     $this->clearTempVlanList();
     // ここにメール送信処理を入れる
     $this->sendEntryMail($target_vlan_id);
     $request['app_id'] = $app_id;
     $request['entry_no'] = $entry_no;
     return true;
 }
 function changeKyotoCardMainData($user_id, $list_no)
 {
     $this->oDb->begin();
     $args = array();
     $args[0] = $user_id;
     // 該当のデータのlist_noをマイナス値に
     $temp_list_no = $list_no * -1;
     $args[1] = $list_no;
     $args[2] = $temp_list_no;
     $sql = $this->getQuery('UPDATE_KYOTO_CARD_LIST_NO', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     // 該当データまでのlist_noを+1
     for ($i = $list_no - 1; $i >= 0; $i--) {
         $args[1] = $i;
         $args[2] = $i + 1;
         $sql = $this->getQuery('UPDATE_KYOTO_CARD_LIST_NO', $args);
         $ret = $this->oDb->query($sql);
         if (!$ret) {
             Debug_Print($sql);
             $this->oDb->rollback();
             return false;
         }
     }
     // マイナス値にしたデータのlist_noを0に
     $args[1] = $temp_list_no;
     $args[2] = 0;
     $sql = $this->getQuery('UPDATE_KYOTO_CARD_LIST_NO', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     return true;
 }
 function deleteData($request)
 {
     $belong_class_id = $request['belong_class_id'];
     // 削除
     $args = $this->getSqlArgs();
     $args[0] = $belong_class_id;
     $sql = $this->getQuery('DELETE_DATA', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
 function updateVpnMembersExpiry(&$request)
 {
     $vpn_id = $request['vpn_id'];
     $aryVpnUserId = $request['checked_id'];
     $aryVpnUserIdUpdated = array();
     $this->oDb->begin();
     // ヘッダのデータを取得
     $aryHead = $this->getVpnData($vpn_id);
     $vpn_kbn = $aryHead['vpn_kbn'];
     foreach ($aryVpnUserId as $index => $vpn_user_id) {
         $before = $this->getVpnMembersData($vpn_id, $vpn_user_id);
         if ($before['expiry_date'] == $request['update_expiry_date']) {
             // 更新前の期限日と比較し、変更が無ければ更新しない
             continue;
         }
         // 変更があったidを保持し、このリストでAD連携を行う
         $aryVpnUserIdUpdated[] = $vpn_user_id;
         $args = $this->getSqlArgs();
         $args['VPN_ID'] = $this->sqlItemInteger($vpn_id);
         $args['VPN_USER_ID'] = $this->sqlItemChar($vpn_user_id);
         $args['EXPIRY_DATE'] = $this->sqlItemChar($request['update_expiry_date']);
         $sql = $this->getQuery('UPDATE_VPN_MEMBERS_EXPIRY', $args);
         Debug_Trace($sql, 444);
         $ret = $this->oDb->query($sql);
         if (!$ret) {
             Debug_Print($sql);
             $this->oDb->rollback();
             return false;
         }
     }
     $this->oDb->end();
     // AD連携
     if ($vpn_kbn == VPN_KBN_VPN) {
         $this->modifyExpiryVpnMembers($aryVpnUserIdUpdated, $request['update_expiry_date']);
     } else {
         $this->modifyExpiryPasslogicMembers($aryVpnUserIdUpdated, $request['update_expiry_date']);
     }
     return true;
 }
 function deleleAppData($app_id)
 {
     $aryOrg = $this->getAppHead($app_id);
     // 区分別にチェック
     list($wire_kbn, $ip_kbn) = $this->getAppTypeKbns($aryOrg['app_type_id']);
     if ($wire_kbn == WIRE_KBN_FREE) {
         $wire_kbn = $request['wire_kbn'];
     }
     $aryOrgList = array();
     if ($wire_kbn == WIRE_KBN_WLESS) {
         $aryOrgList = $this->getAppList($app_id);
     }
     // 削除
     $this->oDb->begin();
     $args = $this->getSqlArgs();
     $args[0] = $app_id;
     $sql = $this->getQuery('DELETE_APP_HEAD_TBL', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $sql = $this->getQuery('DELETE_APP_LIST_TBL', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     // AD連携
     $ret = $this->relationAd($wire_kbn, $aryOrg, array(), $aryOrgList, array());
     if (!$ret) {
         $this->makeAppAdErrLog($app_id);
     }
     return true;
 }
 function rejectMlistEntry($request)
 {
     $mlist_id = $request['mlist_id'];
     $entry_no = $request['entry_no'];
     $agree_note = $request['agree_note'];
     $args = $this->getSqlArgs();
     $args[0] = $mlist_id;
     $args[1] = $entry_no;
     $args['AGREE_NOTE'] = $this->sqlItemChar($agree_note);
     $args['ENTRY_STATUS'] = $this->sqlItemChar(ENTRY_STATUS_REJECT);
     $sql = $this->getQuery('REJECT_MLIST_HEAD_ENTRY', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
 function deleteVpnData($vpn_id)
 {
     $this->oDb->begin();
     // 基本情報
     $args = $this->getSqlArgs();
     $args[0] = $vpn_id;
     $sql = $this->getQuery('DELETE_VPN_HEAD', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $sql = $this->getQuery('DELETE_VPN_ADMIN', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $sql = $this->getQuery('DELETE_VPN_MEMBERS', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     // 同期(メンバーだけ削除)
     //$this->delVpnMemberList($vpn_id);
     return true;
 }
 function makeWirelessId($user_id)
 {
     $aryUser = $this->getUserData($user_id);
     $login_id = $aryUser['login_id'];
     $wireless_id = $this->createWirelessId($login_id);
     $sql = $this->getQuery('EXISTS_WIRELESS_ID', $user_id);
     $ext_id = $this->oDb->getOne($sql);
     if ($ext_id != "") {
         $sql_id = 'UPDATE_WIRELESS_ID';
     } else {
         $sql_id = 'INSERT_WIRELESS_ID';
     }
     $args = $this->getSqlArgs();
     $args[0] = $user_id;
     $args[1] = $wireless_id;
     $sql = $this->getQuery($sql_id, $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
 function insertMlistData(&$request)
 {
     $user_id = $this->getSessionData('LOGIN_USER_ID');
     $this->oDb->begin();
     $id_addr = "";
     if (@$request['mlist_id'] != "") {
         $mlist_id = $request['mlist_id'];
         $entry_kbn = ENTRY_KBN_EDIT;
         $aryOld = $this->getMlistData($mlist_id);
         $mlist_kbn = $aryOld['mlist_kbn'];
     } else {
         $mlist_id = $this->oDb->getSequence("mlist_id_seq");
         $entry_kbn = ENTRY_KBN_ADD;
         $mlist_kbn = $request['mlist_kbn'];
     }
     // 申請番号取得(ロック)
     $sql = $this->getQuery('ENTRY_LOCK', $args);
     $this->oDb->query($sql);
     $sql = $this->getQuery('GET_ENTRY_NO', $mlist_id);
     $entry_no = $this->oDb->getOne($sql);
     $args = $this->getSqlArgs();
     $args['MLIST_ID'] = $this->sqlItemInteger($mlist_id);
     $args['ENTRY_NO'] = $this->sqlItemInteger($entry_no);
     $args['ENTRY_STATUS'] = $this->sqlItemChar(ENTRY_STATUS_ENTRY);
     $args['ENTRY_KBN'] = $this->sqlItemChar($entry_kbn);
     $args['MLIST_NAME'] = $this->sqlItemChar($request['mlist_name']);
     $args['MLIST_ACC'] = $this->sqlItemChar($request['mlist_acc']);
     $args['SENDER_KBN'] = $this->sqlItemChar($request['sender_kbn']);
     $args['MLIST_KBN'] = $this->sqlItemChar($mlist_kbn);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $args['USAGE'] = $this->sqlItemChar($request['usage']);
     $args['ENTRY_ID'] = $this->sqlItemInteger($user_id);
     $sql = $this->getQuery('INSERT_MLIST_HEAD_ENTRY', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     //
     // 管理者データ
     //
     if (is_array($request['admin_id'])) {
         $args = $this->getSqlArgs();
         $args['MLIST_ID'] = $this->sqlItemInteger($mlist_id);
         foreach ($request['admin_id'] as $no => $user_id) {
             $args['ENTRY_NO'] = $this->sqlItemInteger($entry_no);
             $args['LIST_NO'] = $this->sqlItemInteger($no);
             $args['USER_ID'] = $this->sqlItemInteger($user_id);
             $args['ENTRY_ID'] = $this->sqlItemInteger($user_id);
             $sql = $this->getQuery('INSERT_MLIST_ADMIN_ENTRY', $args);
             $ret = $this->oDb->query($sql);
             if (!$ret) {
                 Debug_Print($sql);
                 $this->oDb->rollback();
                 return false;
             }
         }
     }
     // エントリーテーブルを更新
     $ret = $this->updateUserEntryFlg($user_id, 'mlist_entry_flg');
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     // ここにメール送信処理を入れる
     $this->sendEntryMail();
     $request['mlist_id'] = $mlist_id;
     $request['entry_no'] = $entry_no;
     return true;
 }
 function parentChange($request)
 {
     $args = $this->getSqlArgs();
     $args[0] = $request['org_belong_class_id'];
     $args[1] = $request['belong_class_id'];
     $args[2] = implode(",", $request['belong_div_checkbox']);
     $sql = $this->getQuery('UPDATE_PARENT_ID', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
 function truncateMlistAutoSetType($mlist_id, $type = "")
 {
     $args = array();
     $args[0] = $mlist_id;
     $args['TYPE'] = "tbl";
     if ($type != "") {
         $args['TYPE'] = $type;
     }
     $sql = $this->getQuery('TRUNCATE_MLIST_AUTO_SET_TYPE', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         return false;
     }
     return true;
 }
Esempio n. 28
0
 function insertAppData(&$request)
 {
     $request['mac_addr'] = $this->getFlatMacAddr($request['mac_addr']);
     $this->oDb->begin();
     // 区分別にチェック
     list($wire_kbn, $ip_kbn) = $this->getAppTypeKbns($request['app_type_id']);
     if ($wire_kbn == WIRE_KBN_FREE) {
         $wire_kbn = $request['wire_kbn'];
     }
     $request['wireless_id'] = "";
     if ($wire_kbn == WIRE_KBN_WLESS) {
         $aryUser = $this->getUserData($request['app_user_id']);
         $login_id = $aryUser['login_id'];
         $request['wireless_id'] = $this->createWirelessId($login_id);
     }
     $app_id = $this->oDb->getSequence("app_id_seq");
     $args = $this->getSqlArgs();
     $args['APP_ID'] = $this->sqlItemInteger($app_id);
     $args['APP_TYPE_ID'] = $this->sqlItemInteger($request['app_type_id']);
     $args['APP_NAME'] = $this->sqlItemChar($request['app_name']);
     $args['VLAN_ROOM_ID'] = $this->sqlItemInteger($request['vlan_room_id']);
     $args['VLAN_ID'] = $this->sqlItemInteger(@$request['vlan_id']);
     $args['MAC_ADDR'] = $this->sqlItemChar($request['mac_addr']);
     $args['IP_ADDR'] = $this->sqlItemChar($request['ip_addr']);
     $args['WIRE_KBN'] = $this->sqlItemChar(@$request['wire_kbn']);
     $args['IP_KBN'] = $this->sqlItemChar(@$request['ip_kbn']);
     $args['NOTE'] = $this->sqlItemChar($request['note']);
     $args['APP_USER_ID'] = $this->sqlItemInteger($request['app_user_id']);
     $args['WIRELESS_ID'] = $this->sqlItemChar($request['wireless_id']);
     $args['USE_SBC'] = $this->sqlItemFlg(@$request['use_sbc']);
     $sql = $this->getQuery('INSERT_APP_HEAD_TBL', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $aryEntList = array();
     if ($wire_kbn == WIRE_KBN_WLESS) {
         $aryVlan = $this->getTempVlanList();
         if (is_array($aryVlan)) {
             $args = $this->getSqlArgs();
             $args['APP_ID'] = $this->sqlItemInteger($app_id);
             foreach ($aryVlan as $vlan_id => $data) {
                 $args['VLAN_ID'] = $this->sqlItemInteger($vlan_id);
                 $args['BUSY_FLG'] = $this->sqlItemFlg($data['busy_flg']);
                 $sql = $this->getQuery('INSERT_APP_LIST_TBL', $args);
                 $ret = $this->oDb->query($sql);
                 if (!$ret) {
                     Debug_Print($sql);
                     $this->oDb->rollback();
                     return false;
                 }
                 $aryEntList[$vlan_id] = $data;
             }
         }
     }
     $make_wireless_id = false;
     if ($wire_kbn == WIRE_KBN_WLESS) {
         // 無線IDチェック
         $wid = $this->getUserWirelessId($request['app_user_id']);
         if ($wid == "") {
             $this->makeWirelessId($request['app_user_id']);
             if (!$ret) {
                 $this->oDb->rollback();
                 return false;
             }
             $make_wireless_id = true;
         }
     }
     // エントリーテーブルを更新
     $ret = $this->updateUserEntryFlg($request['app_user_id'], 'app_entry_flg');
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     $this->clearTempVlanList();
     // AD連携
     $aryOrg = array();
     $aryOrgList = array();
     $ret = $this->relationAd($wire_kbn, $aryOrg, $request, $aryOrgList, $aryEntList, $make_wireless_id);
     if (!$ret) {
         $this->makeAppAdErrLog($app_id);
     }
     $request['app_id'] = $app_id;
     return true;
 }
Esempio n. 29
0
 function changeWirelessVlan($app_id, $new_vlan_id)
 {
     $aryList = $this->getAppVlanList($app_id);
     if (!is_array($aryList)) {
         return false;
     }
     foreach ($aryList as $vlan_id => $busy_flg) {
         if ($busy_flg == "1") {
             $org_vlan_id = $vlan_id;
             break;
         }
     }
     if ($org_vlan_id == $new_vlan_id) {
         return true;
     }
     $this->oDb->begin();
     // 古いほうのフラグをはずす
     $args = $this->getSqlArgs();
     $args[0] = $app_id;
     if ($org_vlan_id != "") {
         $args[1] = $org_vlan_id;
         $args[2] = "0";
         $sql = $this->getQuery('UPDATE_VLAN_BUSY_FLG', $args);
         $ret = $this->oDb->query($sql);
         if (!$ret) {
             Debug_Print($sql);
             $this->oDb->rollback();
             return false;
         }
     }
     // 新しいほうにフラグをたてる
     $args[1] = $new_vlan_id;
     $args[2] = "1";
     $sql = $this->getQuery('UPDATE_VLAN_BUSY_FLG', $args);
     $ret = $this->oDb->query($sql);
     if (!$ret) {
         Debug_Print($sql);
         $this->oDb->rollback();
         return false;
     }
     $this->oDb->end();
     // 無線用ID取得
     $aryApp = $this->getUsersAppList();
     $wireless_id = $aryApp[$app_id]['wireless_id'];
     // AD連携
     $ret = $this->changeWirelessVlanAd($wireless_id, $org_vlan_id, $new_vlan_id);
     // エラーを記録
     if (!$ret) {
         $user_id = $this->getSessionData('LOGIN_USER_ID');
         // 同じものがないかチェック
         $args = array();
         $args[0] = $user_id;
         $args[1] = $wireless_id;
         $sql = $this->getQuery('EXISTS_WIRELESS_AD_ERR', $args);
         $log_cd = $this->oDb->getOne($sql);
         if ($log_cd == "") {
             // なければ記録する
             // ログコード作成 ランダム数字2文字+マイクロタイムの数字部分のみ
             $rand = rand(10, 99);
             $time = microtime(true);
             list($mae, $ushiro) = explode(".", $time);
             $log_cd = $rand . $mae . str_pad($ushiro, 4, "0");
             $args = array();
             $args[0] = $log_cd;
             $args[1] = $user_id;
             $args[2] = $wireless_id;
             $sql = $this->getQuery('INSERT_WIRELESS_AD_ERR', $args);
             $ret = $this->oDb->query($sql);
             if (!$ret) {
                 Debug_Trace("エラーログの記録に失敗しました[ID:" . $user_id . "、無線ID:" . $wireless_id . "]", 859);
             }
         }
     }
     return true;
 }