コード例 #1
0
    public static function main()
    {
        if (!wbUser::isLoggedIn()) {
            $redirecturl = wbModule::url('bds', 'bds', 'main');
            wbResponse::Redirect(wbModule::url('base', 'base', 'loginform', array('redirecturl' => urlencode($redirecturl))));
        }
        $loadjsmod = wbRequest::getVarClean('loadjsmod', 'str', '');
        wbPage::setPage('jspage');
        $userInfo = wbUser::getSession();
        $role = '';
        if (isset($userInfo['roles'][0]['role_name'])) {
            $role = strtolower($userInfo['roles'][0]['role_name']);
        }
        $script = <<<HEREDOC
    Webi.ROUTE_URL = "ws.php?type=json&module=bds";
    var _UNAME = "{$userInfo['user_name']}";
    var _RNAME = "{$userInfo['user_realname']}";
    var _GNAME = "{$role}";
HEREDOC;
        wbPage::addScriptCode($script);
        wbPage::addScript('modules/bds/views/script/properties.js');
        wbPage::addScript('modules/bds/views/script/GridPanel.js');
        wbPage::addScript('modules/bds/views/script/FormPanel.js');
        wbPage::addScript('modules/bds/views/script/ModulePanel.js');
        wbPage::addScript('modules/base/views/script/roles-jsloader.php');
        wbPage::addScript('modules/bds/views/script/jsloader.php');
        return array('loadjsmod' => $loadjsmod);
    }
コード例 #2
0
 public static function send_email()
 {
     $email = wbRequest::getVarClean('email', 'str', '');
     $npwpd = wbRequest::getVarClean('npwpd', 'str', '');
     $user_name = wbRequest::getVarClean('user_name', 'str', '');
     $question = wbRequest::getVarClean('question', 'str', '');
     $answer = wbRequest::getVarClean('answer', 'str', '');
     $msg = '';
     if (empty($npwpd) or empty($email) or empty($user_name) or empty($answer)) {
         $msg .= 'Semua isian harus diisi. ';
     }
     if (!empty($msg)) {
         wbResponse::Redirect(wbModule::url('bds', 'helper', 'lupa_password', array('email' => $email, 'npwpd' => $npwpd, 'user_name' => $user_name, 'question' => $question, 'answer' => $answer, 'errorMsg' => $msg)));
     }
     /*cek jabawan*/
     try {
         $ws_client = self::getNusoap();
         $data2 = array();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'helper', 'method' => 'cek_jawaban', 'type' => 'json')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data2['items'] = $ws_data['data'];
         $data2['total'] = $ws_data['total'];
         $data2['message'] = $ws_data['message'];
         $data2['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data2['message'] = $e->getMessage();
     }
     $items = $data2['items'];
     if ($data2['total'] > 0 and $data2['success']) {
         /* Ganti Password*/
         try {
             $ws_client = self::getNusoap();
             $data3 = array();
             $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'helper', 'method' => 'ganti_password', 'type' => 'json')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
             $ws_data = self::getResultData($ws_client, $params);
             $data3['items'] = $ws_data['data'];
             $data3['total'] = $ws_data['total'];
             $data3['message'] = $ws_data['message'];
             $data3['success'] = $ws_data['success'];
         } catch (Exception $e) {
             $data3['message'] = $e->getMessage();
         }
         /* Kirim Email */
         $new_password = $data3['message'];
         $respons = file_get_contents('http://202.154.24.3:81/mpd/send_email_forgot_password.php?receiver=' . $email . '&username='******'&password='******'bds', 'helper', 'lupa_password', array('errorMsg' => 'Password Berhasil Diubah. Silahkan cek email Anda untuk mengetahui password terbaru Anda.')));
     } else {
         wbResponse::Redirect(wbModule::url('bds', 'helper', 'lupa_password', array('email' => $email, 'npwpd' => $npwpd, 'user_name' => $user_name, 'question' => $question, 'answer' => $answer, 'hasil_query' => $items, 'errorMsg' => 'Data yang cocok tidak ditemukan.' . $data2['message'])));
     }
 }
コード例 #3
0
ファイル: base_controller.php プロジェクト: rayminami/mpd-wp
 public static function logout()
 {
     $ws_client = self::getNusoap();
     $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'base', 'class' => 'roles.dologin', 'method' => 'logout', 'type' => 'json')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
     wbUser::delSession();
     wbResponse::Redirect('http://45.118.112.232:81/portal/');
 }
コード例 #4
0
 public static function logout()
 {
     wbUser::delSession();
     wbResponse::Redirect('index.php');
 }