whoami7 - Manager
:
/
proc
/
self
/
root
/
home
/
papecmvm
/
www
/
application
/
controllers
/
admin
/
Upload File:
files >> //proc/self/root/home/papecmvm/www/application/controllers/admin/Usermanagement.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); error_reporting(0); class Usermanagement extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index() { $userdata['data']=$this->model->getDatamodel('tblusers'); $this->load->view("users/view_user",$userdata); } public function adduser() { if($this->input->post('save')=='save') { $pass = $this->model->generate_password(); $msg="Username ".$this->input->post('username')."\n Password ".$pass; $this->email->from('kuldeep.parmar@staroneweb.co.in', 'Kuldeep'); $this->email->to($this->input->post('email')); $this->email->subject('Email Test'); $this->email->message($msg); $this->email->send(); $insertdata=array('username'=>$this->input->post('username'), 'email'=>$this->input->post('email'), 'password'=>md5($pass), 'type'=>$this->input->post('type'), 'created_date'=>date('Y-m-d h:m:s'), 'status'=>'active' ); $this->form_validation->set_rules('username', 'username', 'required|xss_clean|regex_match[/^[a-zA-Z_ ]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertData('tblusers',$insertdata); } $this->index(); } else { $this->load->view("users/user_add"); } } public function editUserData($encrypted_string) { $id = $this->model->decryptdata($encrypted_string); $where=array('uid'=>$id); if($this->input->post('save')=='save') { $insertdata=array('username'=>$this->input->post('username'), 'email'=>$this->input->post('email'), 'type'=>$this->input->post('type'), ); $this->form_validation->set_rules('username', 'username', 'required|xss_clean|regex_match[/^[a-zA-Z_ ]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->UpdateData('tblusers',$insertdata,$where); } $userdata['error']=array('errormsg'=>'<div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> User Data successfully Edit. </div>'); $userdata['data']=$this->model->getDatamodel('tblusers'); $this->load->view("users/view_user",$userdata); } else { $data['view']=$this->model->DetailData('tblusers',$where); $this->load->view("users/user_add",$data); } } public function deactiveUserData($id) { //$this->usermodel->deletUser($id); $data=array('status'=>'deactive'); $id=array('uid'=>$id); $this->model->updatedata('tblusers',$data,$id); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> successfully change your Password. </div>'); $userdata['data']=$this->model->getDatamodel('tblusers'); $this->load->view("users/view_user",$userdata); } public function activeUserData($id) { //$this->usermodel->deletUser($id); $data=array('status'=>'active'); $id=array('uid'=>$id); $this->model->updatedata('tblusers',$data,$id); $userdata['error']=array('errormsg'=>'<div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> You successfully Active User. </div>'); $userdata['data']=$this->model->getDatamodel('tblusers'); $this->load->view("header"); $this->load->view("users/view_user",$userdata); $this->load->view("menu"); } public function editUserpass($id) { $data=array('password'=>md5($this->input->post('password'))); $ids=array('uid'=>$id); $conform=array('uid'=>$id,'password'=>md5($this->input->post('old'))); $getuser=$this->db->get_where('tblusers',$conform)->num_rows(); if($getuser==0){ $this->session->set_flashdata('msg', ' <div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Error! </strong> your old password is invalid. </div>'); } else{ $this->model->updatedata('tblusers',$data,$ids); $userdata['data']=$this->model->getDatamodel('tblusers'); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> successfully change Password. </div>'); } redirect('admin/welcome/changepassword'); } }
Copyright ©2021 || Defacer Indonesia