Example #1
0
 function serialize_form()
 {
     $appx = new app();
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         $_SESSION['form_value'] = $appx->serialize64($_GET);
     } else {
         $_SESSION['form_value'] = $appx->serialize64($_POST);
     }
 }
Example #2
0
 $formix->validate('', 'p_uname,p_pwdx');
 if ($formix->is_error()) {
     $msgx->build_msg();
     header("location: index.php");
     exit;
 }
 if ($dbu->anti_sql_injection($_POST['p_uname']) and $dbu->anti_sql_injection($_POST['p_uname'])) {
     // lakukan proses login
     $passwordhash = md5(serialize($p_pwdx));
     $sql = "select *\n\t\t\t\tfrom " . $app['table']['pengguna'] . "\n\t\t\t\twhere username = '******'\n\t\t\t\t\t  and password = '******' and status = 'aktif'\n\t\t\t\tlimit 1";
     $dbu->query($sql, $rs['login'], $nr['login']);
     //echo $nr['login'];exit;
     if ($nr['login']) {
         $formix->reset();
         // $_SESSION['inline_edit'] = "on";
         $_SESSION['adminsession'] = $appx->serialize64($dbu->fetch($rs['login']));
         header("location: " . $app['webmin'] . "/index.php?act=home");
         exit;
     } else {
         //echo "masuk jeh nang kene";exit;
         $msgx->set_msg($app[lang][error]['invalid_login']);
         $msgx->build_msg();
         header("location: index.php");
         exit;
     }
 } else {
     $msgx->set_msg($app[lang][error]['invalid_login']);
     $msgx->build_msg();
     header("location: index.php");
     exit;
 }
Example #3
0
                            break;
                    }
                }
                $imgx->thumbnail(80, 80);
                $imgx->save($app['data_path'] . "/pengguna/avatar/avatar_" . $id . ".jpg");
                $data['avatar'] = "avatar_" . $id . ".jpg";
            } catch (Exception $e) {
                $_SESSION['msg'] = "Avatar Failed To Upload ....";
                $_SESSION['alt'] = "warning";
                header("location: " . $urlx->get_referer());
                exit;
            }
        }
        if ($p_id == $app['me']['id']) {
            $app['me']['id'] = $p_username;
        }
        $appx->mq_encode('p_username,p_name');
        $sql = "update " . $app['table']['pengguna'] . "\n\t\t\t\tset nama = '{$p_name}', \n\t\t\t\t    aplikasi = '{$application}',\n\t\t\t\t    username = '******',\n\t\t\t\t\temail = '{$p_email}',\n\t\t\t\t\tavatar  = '{$data['avatar']}',\n\t\t\t\t\tdibuat_oleh = '" . $app['me']['id'] . "',\n\t\t\t\t\ttgl_modif = now()\n\t\t\t\twhere id = '{$p_id}'";
        // echo $sql;exit;
        $dbu->qry($sql);
        ## am i updated ? if yes then update the session
        if ($p_id == $app['me']['id']) {
            $user = $dbu->get_record("pengguna", "id", $p_id);
            $_SESSION['adminsession'] = $appx->serialize64($user);
        }
        $_SESSION['msg'] = "Data User Berhasil Di Update ....";
        $_SESSION['alt'] = "success";
        header("location: " . $urlx->get_referer());
        exit;
    }
}