Пример #1
0
 public function post_add()
 {
     $avatar = 'uploads/avatar/avatarDefault.png';
     if (\Laravel\Input::has_file('avatar')) {
         $img = \Laravel\Input::file('avatar');
         if ($img['size'] > 100000) {
             return Redirect::to('administration/users/add/')->with_input()->with('notice-error', __('tinyissue.file_sizes_errors'));
         }
         $arr_size = getimagesize($img['tmp_name']);
         if ($arr_size[0] > 200 && $arr_size[1] > 200) {
             return Redirect::to('administration/users/add/')->with_input()->with('notice-error', __('tinyissue.file_size_errors'));
         }
         $destination = "../uploads/avatar/";
         $extensions = array('image/png', 'image/jpg', 'image/jpeg');
         if (in_array($img['type'], $extensions)) {
             $name = md5($img['name'] . rand(11111, 99999)) . "." . $this->extensions($img['type']);
             \Laravel\Input::upload('avatar', $destination, $name);
             $avatar = 'uploads/avatar/' . $name;
         } else {
             return Redirect::to('administration/users/add/')->with_input()->with('notice-error', __('tinyissue.file_type_errors'));
         }
     }
     $add = User::add_user(Input::all(), $avatar);
     if (!$add['success']) {
         return Redirect::to('administration/users/add/')->with_input()->with_errors($add['errors'])->with('notice-error', __('tinyissue.we_have_some_errors'));
     }
     return Redirect::to('administration/users')->with('notice', __('tinyissue.user_added'));
 }
Пример #2
0
 public function post_add()
 {
     $add = User::add_user(Input::all());
     if (!$add['success']) {
         return Redirect::to('administration/users/add/')->with_input()->with_errors($add['errors'])->with('notice-error', 'Whoops, we have a few errors.');
     }
     return Redirect::to('administration/users')->with('notice', 'User Added');
 }
Пример #3
0
 public function post_add()
 {
     $add = User::add_user(Input::all());
     if (!$add['success']) {
         return Redirect::to('administration/users/add/')->with_input()->with_errors($add['errors'])->with('notice-error', __('tinyissue.we_have_some_errors'));
     }
     return Redirect::to('administration/users')->with('notice', __('tinyissue.user_added'));
 }
Пример #4
0
} else {
    $arr['password'] = base64_encode($new_pass);
}
$arr['email'] = $_REQUEST['emailaddress'];
//print_r($arr); exit;
if ($arr['parent_id'] != '' && $arr['email'] && $arr['password'] && $arr['username']) {
    if (isset($_REQUEST['id']) && $_REQUEST['id'] != '') {
        $arr['id'] = $_REQUEST['id'];
        //print_r($arr); exit;
        if ($user->update_user($arr)) {
            send_update_mail($arr['email'], $pass, $arr['user_type']);
            header('Location: http://wmlmusicguide.com/site/admin/master_admin/viewusers.php?act=updated');
            exit;
        } else {
            header('Location: http://wmlmusicguide.com/site/admin/master_admin/adduser.php?success=fail');
            exit;
        }
    } else {
        //echo "";
        if ($user->add_user($arr)) {
            send_create_account_mail($arr['email'], $pass, $arr['user_type']);
            header('Location: http://wmlmusicguide.com/site/admin/master_admin/viewusers.php?act=added');
            exit;
        } else {
            header('Location: http://wmlmusicguide.com/site/admin/master_admin/adduser.php?success=fail');
            exit;
        }
    }
}
//print_r($arr); exit;
layout('adduser', $data);
Пример #5
0
 function register_user()
 {
     $user_obj = new User();
     $helper_obj = new Helper();
     $log_obj = new Payment();
     $db_functions_obj = new DbFunctions();
     $uid = 0;
     $data['username'] = '';
     $data['password'] = '';
     $data['phone'] = '';
     $data['email'] = '';
     $data['add_role'] = 3;
     $data['add_client'] = 47;
     $data['add_country'] = '';
     $data['add_operator'] = '';
     $data['status'] = 1;
     $data['verification_code'] = rand(999, 9999);
     $data['udid'] = $_REQUEST['udid'];
     $data['device_id'] = $_REQUEST['device_id'];
     $data['type'] = $_REQUEST['type'];
     $user_exists = $user_obj->check_user_exists_by_udid($data['udid']);
     if (!$user_exists) {
         $uid = $user_obj->add_user($data, true);
     } else {
         $uid = '-1';
     }
     //$op_details = $db_functions_obj->get_operator_by_id($data['add_operator']);
     /* if ($op_details['type'] == "MO") {
             $from = $op_details['paid_shortcode'];
             $msg = $data['verification_code'];  ///شو لازم تكون المسج
             $smsc = $op_details['paid_smsc']; 
        }
        else{ */
     //   $from = $op_details['free_shortcode'];
     //   $msg = "Your verification code is: " . $data['verification_code'];
     //   $smsc = $op_details['free_smsc'];
     // }
     // $reg_status_decoded = (json_decode($reg_status, true));
     //$uid = $reg_status;
     //$date = time();
     //  $next_time = $date + PAYMENT_END_DATE /*7 days*/;
     //  $log_id = $log_obj->insert($uid, $data['verification_code'], 0, 0);
     //$log_obj->add_payment($uid, $date, $next_time);
     //$root = "http://comm.m-diet.com/mdiet/web/ayman/";
     //   $root = "http://www.jeelplus.com/appstreamig/streaming/api";
     //$dlr_url = $root . 'api.php?action=dlr' . urlencode('&par=%d_');
     //  $dlr_url = $root . 'index.php?action=dlr' . urlencode('&par=%d_');
     // echo $reg_status;
     // return $uid;
     /* if ($uid){   
            $number = $data['phone'];    
            $port = $op_details['port'];
            $msg = urlencode($msg);
            $helper_obj->send_sms($from, $number, $msg, $smsc, $dlr_url, $port);     
        } */
     return $uid;
 }
Пример #6
0
 function add_user()
 {
     global $user;
     $user_obj = new User();
     $db_function_obj = new DbFunctions();
     $helper_obj = new Helper();
     $uid = $user['id'];
     $rid = $user['rid'];
     //only super admin can delete client
     if ($helper_obj->user_is_logged_in() && $helper_obj->check_role(SUPER_ADMIN_ROLE_ID) && isset($_POST) && $_POST['username'] != "" && $_POST['password'] && $_POST['email'] && $_POST['phone'] && $_POST['add_role']) {
         $last_uid = $user_obj->add_user($_POST);
         $user_info = $db_function_obj->get_user_detail_by_id($last_uid);
         $output = $user_obj->build_user_row($user_info);
         echo $output;
         exit;
     }
 }
Пример #7
0
<?php

if (!empty($_POST)) {
    $user = new User();
    $errors = [];
    if (empty($_POST['pseudo'])) {
        $errors[] = 'Veuillez entrer un login';
    }
    if (empty($_POST['pass'])) {
        $errors[] = 'Veuillez entrer un password';
    }
    if (empty($errors)) {
        $errors[] = User::add_user($_POST['pseudo'], $_POST['pass']);
    }
}
Пример #8
0
        <button  type="button" class="btn btn-default" data-dismiss="modal">Закрити</button>
        <button type="submit" name="open" class="btn btn-primary">Війти</button>
        </div>
        </form>
      </div>
    </div>
  </div>
</div>
                  <?php 
    if (isset($_POST['res'])) {
        $login = $_POST['login'];
        $password = $_POST['password'];
        $email = $_POST['email'];
        $password2 = $_POST['password2'];
        $users = new User($login, $password, $password2, $email);
        $enter = $users->add_user();
        if ($enter) {
            ?>
                        <script>
                        alert('Дякуєм ви успішно зареєструвались');
                        </script>
                        <?php 
        } else {
            ?>
                        <script>
                        alert('Помилка реєстрації: повторіть спробу');
                        </script>
                        <?php 
        }
    }
} else {
Пример #9
0
 public function post_user_add()
 {
     $input = Input::all();
     $validation = User::validate($input);
     if ($validation->fails()) {
         return Redirect::to_route('settings_user')->with_errors($validation);
     } else {
         $add = User::add_user($input);
         return Redirect::to_route('settings_user')->with('message', $add);
     }
 }
<?php

include "classes/class.user.php";
$user = new User();
//print_r($_POST); exit;
$user_detail['username'] = $_POST['username'];
$user_detail['password'] = $_POST['password'];
$user_detail['email'] = $_POST['emailaddress'];
if (isset($_POST['user_id']) && !empty($_POST['user_id'])) {
    $user_detail['id'] = $_POST['user_id'];
    $user->update_user($user_detail);
    header("Location: http://wmlmusicguide.com/site/admin/master_admin/viewuser.php?act=updated");
    exit;
} else {
    //print_r($user_detail); exit;
    //$check=$user->add_user($user_dateil);
    if ($user->add_user($user_detail)) {
        header('Location: http://wmlmusicguide.com/site/admin/master_admin/viewuser.php?act=added');
    } else {
        header('Location: http://wmlmusicguide.com/site/admin/master_admin/adduser.php?success=fail');
    }
}
Пример #11
0
<?php

session_start();
require_once 'models/user.php';
$userModel = new User();
if (!empty($_POST['register'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $phone = $_POST['phone'];
    $real_name = $_POST['real_name'];
    $free_mail = $userModel->check_email($email);
    if ($free_mail) {
        $userModel->add_user($real_name, $email, $phone, $password);
        $user = $userModel->check_user($email, $password);
        $_SESSION['user_id'] = $user['id'];
        redirect('/profile.php');
    } else {
        $_SESSION['message'] = 'Этот email уже используется!';
        redirect('/profile.php');
    }
}
redirect('/404.html');