function __construct()
 {
     $session = new Session();
     $getSessi = $session->get_session();
     $this->user = $getSessi['login'];
 }
 function __construct()
 {
     parent::__construct();
     $session = new Session();
     $getSessi = $session->get_session();
     $this->user = $getSessi[0];
 }
 function __construct()
 {
     parent::__construct();
     $session = new Session();
     $getSessi = $session->get_session();
     $this->user = $getSessi['ses_user']['login'];
 }
 function __construct()
 {
     $sessi = new Session();
     $getUserSes = $sessi->get_session('login');
     $this->user = $getUserSes['login']['login'];
     $this->prefix = "lelang";
 }
 function __construct()
 {
     $session = new Session();
     $getSessi = $session->get_session();
     $this->user = $getSessi['login'];
     $this->loadmodule();
     $this->salt = '12345678PnD';
 }
Beispiel #6
0
 public function __construct()
 {
     parent::__construct();
     $this->loadmodule();
     $this->view = $this->setSmarty();
     $sessionAdmin = new Session();
     $this->admin = $sessionAdmin->get_session();
 }
 function __construct()
 {
     $loadSession = new Session();
     $getUserData = $loadSession->get_session();
     $this->user = $getUserData[0];
     $this->salt = "ovancop1234";
     $this->token = str_shuffle('cmsaj23y4ywdni237yeisa');
     $this->date = date('Y-m-d H:i:s');
 }
 public function check_session()
 {
     $this->session = Session::get_session();
     if ($this->session != NULL) {
         echo "done";
         $this->session->check_session();
     } else {
         echo "not done";
     }
 }
Beispiel #9
0
 public function __construct()
 {
     parent::__construct();
     $this->loadmodule();
     $this->view = $this->setSmarty();
     $sessionAdmin = new Session();
     $this->admin = $sessionAdmin->get_session();
     global $app_domain;
     $this->view->assign('app_domain', $app_domain);
 }
 function __construct()
 {
     error_reporting(E_ALL ^ E_NOTICE);
     parent::__construct();
     $loadSession = new Session();
     $getUserData = $loadSession->get_session();
     $this->user = $getUserData[0];
     $this->salt = "ovancop1234";
     $this->token = str_shuffle('cmsaj23y4ywdni237yeisa');
     $this->date = date('Y-m-d H:i:s');
 }
 public function __construct()
 {
     parent::__construct();
     global $app_domain;
     $this->loadmodule();
     $this->view = $this->setSmarty();
     $sessionAdmin = new Session();
     $this->admin = $sessionAdmin->get_session();
     $this->view->assign('app_domain', $app_domain);
     $this->folder = CODEKIR_TEMPLATE . '/contentManagement/analysisArea/';
 }
 public function __construct()
 {
     parent::__construct();
     global $app_domain;
     $this->loadmodule();
     $this->view = $this->setSmarty();
     $sessionAdmin = new Session();
     $this->admin = $sessionAdmin->get_session();
     // $this->validatePage();
     $this->view->assign('app_domain', $app_domain);
     $this->token = str_shuffle('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890');
 }
Beispiel #13
0
 public function __construct()
 {
     parent::__construct();
     global $app_domain;
     global $app_domain;
     $this->loadmodule();
     $this->view = $this->setSmarty();
     $sessionAdmin = new Session();
     $this->admin = $sessionAdmin->get_session();
     $this->view->assign('app_domain', $app_domain);
     $this->folder = CODEKIR_TEMPLATE . '/master/catMedia/';
 }
 function __construct()
 {
     global $CONFIG;
     parent::__construct();
     $loadSession = new Session();
     $getUserData = $loadSession->get_session();
     $this->user = $getUserData[0];
     $this->salt = $CONFIG['default']['salt'];
     $this->prefix = "";
     $this->date = date('Y-m-d H:i:s');
     $this->token = str_shuffle('1q2w3e4r5t6y7u8i9o0pazsxdcfvgbhnjmkl');
 }
Beispiel #15
0
 /**
  *
  */
 private function is_session_expired()
 {
     $a_return_values = array();
     $b_session_valid = true;
     $o_session = \Session::get_session();
     if (!$o_session->is_session_valid()) {
         $s_message = \View::create('message')->render(false, true);
         $b_session_valid = false;
         $o_session->create_new_session();
         $a_return_values['message'] = $s_message;
     }
     $a_return_values['session_valid'] = $b_session_valid;
     echo json_encode($a_return_values);
 }
 /**
  * @todo edit user password
  */
 function editPassword($data = false)
 {
     if ($data == false) {
         return false;
     }
     global $CONFIG;
     $salt = $CONFIG['default']['salt'];
     $password = sha1($data['newPassword'] . $salt);
     $session = new Session();
     $ses_user = $session->get_session();
     $user = $ses_user;
     $sql = "UPDATE `florakb_person` SET `password` = '" . $password . "', `salt` = '" . $salt . "' WHERE `id` = '" . $user['login']['id'] . "' ";
     $res = $this->query($sql, 1);
     if ($res) {
         return true;
     }
 }
Beispiel #17
0
 /**
  * This method initialize the current language and the current step
  *
  */
 private function init()
 {
     //get the current post-request and check if the language was given by POST
     $s_post = \Globals::get('_POST');
     if (!is_null($s_post['game_language'])) {
         \Session::get_session()->set_value('language', $s_post['game_language']);
     }
     //Initialize the I18N-Class for templates-usage
     \I18N::init();
     //if we have no language-value in the session, set the default install-language to ENGLISH
     if (is_null(\Session::get_session()->get_value('language'))) {
         \I18N::set_language('en_EN');
     } else {
         \I18N::set_language(\Session::get_session()->get_value('language'));
     }
     \Replacer::set_language(\I18N::get_language());
     //set the current step by POST
     $this->i_step = $s_post['install_step'];
 }
Beispiel #18
0
 /**
  * @todo fetch folder function basedomain/zip/extract
  * 
  * @see createFolder Function
  * @see getContents Function
  * @see resize & crop Function
  * @see validateUsername Function
  * @see imagezip class
  * 
  * */
 function fetch_folder($status = NULL, $msg = NULL, $data = NULL)
 {
     global $CONFIG;
     $name = $_POST['imagezip'];
     $path = '';
     $path_folder = $CONFIG['default']['root_data'];
     //get data user from session
     $session = new Session();
     $sess_data = $session->get_session();
     $username = $sess_data['login']['username'];
     $personID = $sess_data['login']['id'];
     $password = $sess_data['login']['password'];
     if (empty($username) || empty($personID) || empty($password)) {
         $status = "error";
         $msg = "Kesalahan terjadi saat validasi data pengguna, silakan logout kemudian login kembali";
         echo json_encode(array('status' => $status, 'message' => $msg));
         exit;
     }
     if (!empty($name)) {
         $file = $path_folder . $name;
         //check file zip exist
         if (!is_dir($file)) {
             $status = "error";
             $msg = "Sistem tidak dapat menemukan folder yang ditentukan";
             echo json_encode(array('status' => $status, 'message' => $msg));
             exit;
         }
         $path_data = 'public_assets/';
         //$path_user = $path_data.$username;
         $path_img = $path_data . '/img';
         $path_img_ori = $path_img . '/ori';
         $path_img_1000px = $path_img . '/1000px';
         $path_img_500px = $path_img . '/500px';
         $path_img_100px = $path_img . '/100px';
         $toCreate = array($path_img, $path_img_ori, $path_img_1000px, $path_img_500px, $path_img_100px);
         $permissions = 0755;
         if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
             createFolder($toCreate, $permissions);
         } else {
             shell_createFolder($toCreate);
         }
         $images = $this->GetContents($file);
         $list = count($images);
         $dataNotExist = array();
         foreach ($images as $image) {
             $entry = $image['filename'];
             $path_entry = $image['path'];
             $len = strlen($file);
             $folder = substr($path_entry, $len);
             if (preg_match('#\\.(jpg|jpeg|JPG|JPEG)$#i', $entry)) {
                 $image_name_encrypt = md5(str_shuffle($CONFIG['default']['salt'] . $entry));
                 $fileinfo = getimagesize($path_entry . '/' . $entry);
                 if (!$fileinfo) {
                     $status = "error";
                     $msg = "Tidak ada informasi jenis berkas";
                 } else {
                     $valid_types = array(IMAGETYPE_JPEG);
                     $valid_mime = array('image/jpeg');
                     if (in_array($fileinfo[2], $valid_types) || in_array($fileinfo['mime'], $valid_mime)) {
                         $mime = true;
                     } else {
                         $mime = false;
                     }
                     if ($mime) {
                         //check file exist here
                         //$dataExist = $this->imagezip->dataExist($entry);
                         $dataExist = $this->imagezip->imageExist($entry);
                         //add file information to array
                         $fileToInsert = array('filename' => $entry, 'md5sum' => $image_name_encrypt, 'directory' => $folder, 'mimetype' => $fileinfo['mime']);
                         if ($dataExist) {
                             //get detail image
                             $detail_image = $this->imagezip->get_image_by_name($entry);
                             if ($detail_image['md5sum']) {
                                 $delete_image = array($path_img_ori . '/' . $detail_image['md5sum'] . '.ori.jpg', $path_img_1000px . '/' . $detail_image['md5sum'] . '.1000px.jpg', $path_img_500px . '/' . $detail_image['md5sum'] . '.500px.jpg', $path_img_100px . '/' . $detail_image['md5sum'] . '.100px.jpg');
                                 //delete old image
                                 $this->delete_img($delete_image);
                             }
                             copy($path_entry . "/" . $entry, $path_img_ori . '/' . $image_name_encrypt . '.ori.jpg');
                             copy($path_entry . "/" . $entry, $path_img_1000px . '/' . $image_name_encrypt . '.1000px.jpg');
                             if (!@copy($path_entry . "/" . $entry, $path_img_1000px . '/' . $image_name_encrypt . '.1000px.jpg')) {
                                 $status = "error";
                                 $msg = error_get_last();
                             } else {
                                 $src_tmp = $path_entry . "/" . $entry;
                                 $dest_1000px = $CONFIG['default']['root_path'] . '/' . $path_img_1000px . '/' . $image_name_encrypt . '.1000px.jpg';
                                 $dest_500px = $CONFIG['default']['root_path'] . '/' . $path_img_500px . '/' . $image_name_encrypt . '.500px.jpg';
                                 $dest_100px = $CONFIG['default']['root_path'] . '/' . $path_img_100px . '/' . $image_name_encrypt . '.100px.jpg';
                                 if ($fileinfo[0] >= 1000 || $fileinfo[1] >= 1000) {
                                     if ($fileinfo[0] > $fileinfo[1]) {
                                         $percentage = 1000 / $fileinfo[0];
                                         $config['width'] = $percentage * $fileinfo[0];
                                         $config['height'] = $percentage * $fileinfo[1];
                                     } else {
                                         $percentage = 1000 / $fileinfo[1];
                                         $config['width'] = $percentage * $fileinfo[0];
                                         $config['height'] = $percentage * $fileinfo[1];
                                     }
                                     $this->resize_pic($src_tmp, $dest_1000px, $config);
                                     unset($config);
                                 }
                                 //Set cropping for y or x axis, depending on image orientation
                                 if ($fileinfo[0] > $fileinfo[1]) {
                                     $config['width'] = $fileinfo[1];
                                     $config['height'] = $fileinfo[1];
                                     $config['x_axis'] = $fileinfo[0] / 2 - $config['width'] / 2;
                                     $config['y_axis'] = 0;
                                 } else {
                                     $config['width'] = $fileinfo[0];
                                     $config['height'] = $fileinfo[0];
                                     $config['x_axis'] = 0;
                                     $config['y_axis'] = $fileinfo[1] / 2 - $config['height'] / 2;
                                 }
                                 $this->cropToSquare($src_tmp, $dest_500px, $config);
                                 unset($config);
                                 //set new config
                                 $config['width'] = 500;
                                 $config['height'] = 500;
                                 $this->resize_pic($dest_500px, $dest_500px, $config);
                                 unset($config);
                                 $config['width'] = 100;
                                 $config['height'] = 100;
                                 $this->resize_pic($dest_500px, $dest_100px, $config);
                                 unset($config);
                                 //update data
                                 $insertImage = $this->imagezip->updateImage($personID, $fileToInsert);
                             }
                             // end if copy
                         } else {
                             //add data information to array
                             array_push($dataNotExist, $fileToInsert);
                         }
                     }
                 }
             }
         }
         $count_dataNotExist = count($dataNotExist);
         if ($list == $count_dataNotExist) {
             $status = 'warning';
             $msg = 'File berhasil diekstrak. Tidak ada gambar yang sesuai dengan data.';
             $data['dataNotExist'] = $dataNotExist;
         } else {
             //send dataNotExist information to user
             $status = 'success';
             $msg = 'File berhasil diekstrak';
             $data['dataNotExist'] = $dataNotExist;
         }
     } else {
         $status = "error";
         $msg = 'Nama file tidak boleh kosong';
     }
     echo json_encode(array('status' => $status, 'message' => $msg, 'data' => $data));
     exit;
 }
Beispiel #19
0
date_default_timezone_set('Europe/Berlin');
/*
 * Enable the auto-loader.
 * it will be accept namespace-based classes and also classes
 * with underscores. It will replace the underscores as path to the class.
 */
spl_autoload_register(function ($class) {
    spl_autoload(str_replace('_', DIRECTORY_SEPARATOR, $class));
});
//Clear complete cache if needed.
//Cache::getInstance()->clear();
//die;
//Initialize the random number generator
mt_srand(LOGD::make_seed());
//Initialize the Session and the Routing
Session::get_session();
Routing::init();
//check if the dbconfig.default.php exist, if yes - we have to install the game
if (!file_exists(dirname(LOGD_ROOT) . DIRECTORY_SEPARATOR . '.dbconfig' . EXT) && file_exists(dirname(LOGD_ROOT) . DIRECTORY_SEPARATOR . '.dbconfig.default' . EXT)) {
    //try-catch the installer, if it fails
    try {
        new \Install\Installer();
    } catch (LOGD_Exception $e) {
        $e->print_error();
    }
    exit(1);
}
//Initialize the language Class
//todo this is later only a fallback if nothing found in the database
//I18N::init(GAME_LANGUAGE);
//including the .dbconfig.php with all Database-Constants
# --------------------------------------------------------------------------
# Realizando a  Deleção dos Setores
# --------------------------------------------------------------------------
if (Context::get_context('deletar')) {
    if ($setor->delete(Request::in_get('id'))) {
        Session::flash('success', 'Setor Deletado com Sucesso');
        return Redirect::to_view('setores.listar');
    }
}
# --------------------------------------------------------------------------
# Realizando a Edição dos Setores
# --------------------------------------------------------------------------
if (Context::get_context('editar')) {
    $data['nome'] = Request::in_post('nome');
    $data['descricao'] = Request::in_post('descricao');
    $data['data_cadastro'] = Date::date_now('br');
    $data['vinculo_empresa'] = Session::get_session('vinculo_empresa');
    $id = Request::in_get('id', true);
    if (Filter::is_empty_array($data)) {
        Session::flash('error', 'Todos os campos são obrigatórios');
        return Redirect::to_view('setores.cadastrar');
    }
    $data['responsavel'] = Request::in_post('responsavel');
    if (Filter::is_empty($data['responsavel'])) {
        $data['responsavel'] = 0;
    }
    if ($setor->update($data, $id)) {
        Session::flash('success', 'Setor Editado com Sucesso');
        return Redirect::to_view('setores.editar', "id={$id}");
    }
}
 function __construct()
 {
     $usersess = new Session();
     $userArr = $usersess->get_session();
     $this->user = $userArr['admin'];
 }
<?php

include "../../config/config.php";
include "{$path}/header.php";
include "{$path}/title.php";
//$alamat_simpul_lokasi="$url_rewrite/function/dropdown/simpul_lokasi.php";
//$alamat_search_lokasi="$url_rewrite/function/dropdown/search_lokasi.php";
$USERAUTH = new UserAuth();
$DBVAR = new DB();
$SESSION = new Session();
$menu_id = 42;
$SessionUser = $SESSION->get_session_user();
$SessionUser['ses_uid'] != '' ? $Session = $SessionUser : ($Session = $SESSION->get_session(array('title' => 'GuestMenu', 'ses_name' => 'menu_without_login')));
$USERAUTH->FrontEnd_check_akses_menu($menu_id, $SessionUser);
echo "<pre>";
//print_r($_SESSION);
echo "</pre>";
//js_lokasi($alamat_simpul_lokasi, $alamat_search_lokasi,"lda_lokasi","lokasi_id",'lokasi');
//$style1="style=\"width:525px; height:220px; overflow:auto; border: 1px solid #dddddd;\"";
//lokasi($style1,"lokasi_id",'lokasi');
?>
<html>
    
    <!--
    <script type="text/javascript">
	function show_confirm()
	{
	var r=confirm("Tidak ada data yang dijadikan filter? Seluruh isian filter kosong.");
	if (r==true)
	{
	 alert("Anda akan masuk ke halaman daftar pemeliharaan Barang");
Beispiel #23
0
<?php

if (isset($_POST['email']) && isset($_POST['password'])) {
    session_start();
    include 'classes/User.php';
    include_once 'classes/Session.php';
    $user = new User();
    $session = new Session();
    $user->email = strip_tags($_POST['email']);
    $user->password = strip_tags($_POST['password']);
    if ($user->check_user()) {
        $user_type = $session->get_session('user_type');
        if ($user_type == 3) {
            header("Location: users.php");
            exit;
        } else {
            if ($user_type == 0) {
                header("Location: institutes.php");
                exit;
            }
        }
        header("Location: index.php");
        exit;
    } else {
        $_SESSION['login-error'] = '<div class="error message">
 <h3>Please login with valid credentials.</h3>
</div>';
        header("Location: login.php");
        exit;
    }
}
Beispiel #24
0
<?php

# Chama os Models necessários
$empresa = Container::Empresa_utilizadora();
$login = Container::Login();
# Busca o Usuário e a Empresa pelo id
$data_empresa = $empresa->find(Session::get_session('vinculo_empresa'));
$data_login = $login->find(Session::get_session('id_usuario'));
# Seta os id´s do Usuário e da Empresa
$id_usuario = Request::in_get('id');
$id_empresa = $data_empresa['id'];
?>
 
    <section class="right_container">
        
        <!--Mensagens flash-->
        <?php 
if (Session::has_flash('error')) {
    ?>
            <p class="alert alert-danger fade in">
                <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                <?php 
    Session::get_flash('error');
    ?>
            </p>
        <?php 
} elseif (Session::has_flash('success')) {
    ?>
            <p class="alert alert-success fade in">
                <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                <?php 
Beispiel #25
0
 function isAdminOnline()
 {
     global $CONFIG;
     if (!$this->configkey) {
         $this->configkey = 'admin';
     }
     $uniqSess = sha1($CONFIG['admin']['root_path'] . 'codekir-v0.1' . $this->configkey);
     $session = new Session();
     $userOnline = $session->get_session();
     // vd($userOnline);exit;
     if ($userOnline) {
         return $userOnline;
     } else {
         return false;
     }
 }
Beispiel #26
0
    ?>
            <!--end menu Admin-->

				<li><a href="">Configuração de Ambiente</a></li>
				<?php 
    $id = Session::get_session('id_usuario');
    ?>
				<li><a href=<?php 
    Helper::link_to_view('empresa_administradora.editar', "id={$id}");
    ?>
>Dados da Minha Empresa</a></li>
			</ul>
             
        <!--Mostra esse Menu apenas para a emprea com o perfil de Número 1, ou seja, Admin-->
        <?php 
    if (Session::get_session('perfil_usuario') == 1) {
        ?>
            <br>
			<h4 class="caption">Cadastro de Cliêntes</h4>
			<ul class="ul_left_menu">
				<li><a href="">Cadastrar pessoa Física</a></li>
				<li><a href=<?php 
        Helper::link_to_view('empresas_externas.cadastrar');
        ?>
>Cadastrar pessoa Jurídica (Empresa)</a></li>
			</ul>
		<?php 
    }
    ?>
		<!--end menu Admin-->
            
 /**
  * @todo insert image from posted data
  * */
 public function addImg()
 {
     global $CONFIG;
     $data = $_POST;
     $indivID = $_GET['id'];
     $name = 'filename';
     $path = '';
     $uploaded_file = uploadFile($name, $path, 'image');
     //if uploaded
     if ($uploaded_file['status'] != '0') {
         logFile('Upload Success');
         if (extension_loaded('gd') && function_exists('gd_info')) {
             logFile('GD2 is installed. Checking image data.');
             //validate email and get short_namecode
             $ses_user = $this->isUserOnline();
             $username = $ses_user['login']['username'];
             $personID = $ses_user['login']['id'];
             $tmp_name = $uploaded_file['full_name'];
             $entry = str_replace(array('\'', '"'), '', $uploaded_file['real_name']);
             $image_name_encrypt = md5($entry);
             //check filename
             $dataExist = $this->imagezip->dataExist($personID, $entry);
             $path_entry = $CONFIG['default']['upload_path'];
             $src_tmp = $path_entry . "/" . $tmp_name;
             if (!$dataExist) {
                 logFile('Prepare to cropping image');
                 $path_data = 'public_assets/';
                 //$path_user = $path_data.$username;
                 $path_img = $path_data . '/img';
                 $path_img_1000px = $path_img . '/1000px';
                 $path_img_500px = $path_img . '/500px';
                 $path_img_100px = $path_img . '/100px';
                 $fileinfo = getimagesize($path_entry . '/' . $tmp_name);
                 $toCreate = array($path_img, $path_img_1000px, $path_img_500px, $path_img_100px);
                 createFolder($toCreate, 0755);
                 copy($path_entry . "/" . $tmp_name, $path_img_1000px . '/' . $image_name_encrypt . '.1000px.jpg');
                 if (!@copy($path_entry . "/" . $tmp_name, $path_img_1000px . '/' . $image_name_encrypt . '.1000px.jpg')) {
                     logFile('Copy file failed');
                     $status = "error";
                     $msg = error_get_last();
                 } else {
                     logFile('Copy file success');
                     $dest_1000px = $CONFIG['default']['root_path'] . '/' . $path_img_1000px . '/' . $image_name_encrypt . '.1000px.jpg';
                     $dest_500px = $CONFIG['default']['root_path'] . '/' . $path_img_500px . '/' . $image_name_encrypt . '.500px.jpg';
                     $dest_100px = $CONFIG['default']['root_path'] . '/' . $path_img_100px . '/' . $image_name_encrypt . '.100px.jpg';
                     if ($fileinfo[0] >= 1000 || $fileinfo[1] >= 1000) {
                         if ($fileinfo[0] > $fileinfo[1]) {
                             $percentage = 1000 / $fileinfo[0];
                             $config['width'] = $percentage * $fileinfo[0];
                             $config['height'] = $percentage * $fileinfo[1];
                         } else {
                             $percentage = 1000 / $fileinfo[1];
                             $config['width'] = $percentage * $fileinfo[0];
                             $config['height'] = $percentage * $fileinfo[1];
                         }
                         $this->resize_pic($src_tmp, $dest_1000px, $config);
                         unset($config);
                     }
                     logFile('Cropping to 1000px image');
                     //Set cropping for y or x axis, depending on image orientation
                     if ($fileinfo[0] > $fileinfo[1]) {
                         $config['width'] = $fileinfo[1];
                         $config['height'] = $fileinfo[1];
                         $config['x_axis'] = $fileinfo[0] / 2 - $config['width'] / 2;
                         $config['y_axis'] = 0;
                     } else {
                         $config['width'] = $fileinfo[0];
                         $config['height'] = $fileinfo[0];
                         $config['x_axis'] = 0;
                         $config['y_axis'] = $fileinfo[1] / 2 - $config['height'] / 2;
                     }
                     $this->cropToSquare($src_tmp, $dest_500px, $config);
                     unset($config);
                     logFile('Cropping to square image');
                     //set new config
                     $config['width'] = 500;
                     $config['height'] = 500;
                     $this->resize_pic($dest_500px, $dest_500px, $config);
                     unset($config);
                     logFile('Cropping to 500px image');
                     $config['width'] = 100;
                     $config['height'] = 100;
                     $this->resize_pic($dest_500px, $dest_100px, $config);
                     unset($config);
                     logFile('Cropping to 100px image');
                     //add file information to array
                     $data['filename'] = $entry;
                     $data['md5sum'] = $image_name_encrypt;
                     $data['mimetype'] = $fileinfo['mime'];
                     $data['indivID'] = $indivID;
                     $data['personID'] = $personID;
                     $insertData = $this->insertonebyone->insertTransaction('img', $data);
                     if ($insertData) {
                         logFile('Insert Data Success');
                         $this->msg->add('s', 'Sukses Memperbarui Gambar');
                         $session = new Session();
                         $dataSession = array();
                         $sess_image = $session->get_session();
                         if (isset($sess_image['image_sess'])) {
                             logFile('Fetch image session');
                             foreach ($sess_image['image_sess'] as $data_before) {
                                 array_push($dataSession, $data_before);
                             }
                         }
                         array_push($dataSession, $data);
                         $session->set_session($dataSession, 'image_sess');
                         //$session->delete_session('onebyone');
                     } else {
                         logFile('Insert Data Failed');
                         $this->msg->add('e', 'Gagal Memperbarui Gambar');
                     }
                 }
                 // end if copy
             } else {
                 logFile('File Image exist');
                 $this->msg->add('e', 'Data Gambar Telah Ada');
             }
             unlink($src_tmp);
         } else {
             logFile('GD2 is not installed');
             $this->msg->add('e', 'Sistem Error. Harap menghubungi tim developer kami.');
         }
     } else {
         logFile('Upload Image Failed');
         $this->msg->add('e', $uploaded_file['message']);
     }
     //header('Location: ../../browse/editIndiv/?id='.$indivID);
     redirect($basedomain . '../editIndiv/?id=' . $indivID . '#img');
 }
Beispiel #28
-1
 public function change_password($pass)
 {
     $db = new Database();
     $session = new Session();
     $id = $session->get_session('userid');
     $query = "UPDATE userdetail SET Password='******' WHERE UserID='{$id}'";
     $result = $db->runQuery($query);
     if ($result) {
         return 1;
     } else {
         return 0;
     }
 }
 /**
  * @todo edit user password
  */
 function editPassword($data = false)
 {
     if ($data == false) {
         return false;
     }
     global $CONFIG;
     $salt = $CONFIG['default']['salt'];
     $password = sha1($data['newPassword'] . $salt);
     if ($data['userid']) {
         $id = $data['userid'];
     } else {
         $session = new Session();
         $ses_user = $session->get_session();
         $user = $ses_user;
         $id = $user['login']['id'];
     }
     $sql = "UPDATE `{$this->prefix}_person_extra` SET `password` = '" . $password . "', `salt` = '" . $salt . "' WHERE `id` = '{$id}' ";
     $res = $this->query($sql, 1);
     if ($res) {
         return true;
     }
 }