access control issue fix
This commit is contained in:
parent
2e653d8468
commit
91c14858bc
@ -1091,7 +1091,7 @@ function attendanceyear($empID ='')
|
|||||||
// {
|
// {
|
||||||
|
|
||||||
$this->form_validation->set_rules('EmpList','EmpList','trim|callback_Employee_validateS');
|
$this->form_validation->set_rules('EmpList','EmpList','trim|callback_Employee_validateS');
|
||||||
$this->form_validation->set_rules('role','role','trim|callback_Role_validate');
|
// $this->form_validation->set_rules('role','role','trim|callback_Role_validate');
|
||||||
$this->form_validation->set_rules('password','Password','required|max_length[20]');
|
$this->form_validation->set_rules('password','Password','required|max_length[20]');
|
||||||
$this->form_validation->set_rules('cpassword','Confirm Password','trim|required|matches[password]|max_length[20]');
|
$this->form_validation->set_rules('cpassword','Confirm Password','trim|required|matches[password]|max_length[20]');
|
||||||
|
|
||||||
@ -1103,7 +1103,7 @@ function attendanceyear($empID ='')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$EmpID = $this->input->post('EmpList');
|
$EmpID = $this->input->post('EmpList');
|
||||||
$roleId = $this->input->post('role');
|
$roleId = '2';
|
||||||
$password = $this->input->post('password');
|
$password = $this->input->post('password');
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
$Createddt = $dt->format('Y-m-d H:i:s');
|
$Createddt = $dt->format('Y-m-d H:i:s');
|
||||||
@ -1117,9 +1117,15 @@ function attendanceyear($empID ='')
|
|||||||
|
|
||||||
|
|
||||||
$userInfo = array('email'=>$email,'EmpID'=>$EmpID,'password'=>getHashedPassword($password),'roleId'=>$roleId,'createdBy'=>$this->vendorId,'createdDtm'=>$Createddt);
|
$userInfo = array('email'=>$email,'EmpID'=>$EmpID,'password'=>getHashedPassword($password),'roleId'=>$roleId,'createdBy'=>$this->vendorId,'createdDtm'=>$Createddt);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//die();
|
||||||
|
|
||||||
$result = $this->user_model->addNewUser($userInfo);
|
$result = $this->user_model->addNewUser($userInfo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ($j = 0; $j < count($comma_separated); $j++)
|
for ($j = 0; $j < count($comma_separated); $j++)
|
||||||
{
|
{
|
||||||
$DeptCode = $comma_separated[$j];
|
$DeptCode = $comma_separated[$j];
|
||||||
@ -1134,8 +1140,9 @@ function attendanceyear($empID ='')
|
|||||||
if($result > 0)
|
if($result > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
redirect('userListing','refresh');
|
|
||||||
echo "<script>alert('New User Created successfully!');</script>";
|
echo "<script>alert('New User Created successfully!');</script>";
|
||||||
|
redirect('userListing','refresh');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,7 @@ class User_model extends CI_Model
|
|||||||
*/
|
*/
|
||||||
function addNewUser($userInfo)
|
function addNewUser($userInfo)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->db->trans_start();
|
$this->db->trans_start();
|
||||||
$this->db->insert('tbl_users', $userInfo);
|
$this->db->insert('tbl_users', $userInfo);
|
||||||
|
|
||||||
|
|||||||
@ -109,8 +109,24 @@
|
|||||||
<input type="text" class="form-control required digits" readonly id="ContactNo" name="ContactNo" minlength="10"maxlength="10">
|
<input type="text" class="form-control required digits" readonly id="ContactNo" name="ContactNo" minlength="10"maxlength="10">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
|
||||||
<div class="form-group">
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="password">Password</label>
|
||||||
|
<input type="password" class="form-control required" id="password" required name="password" maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="cpassword">Confirm Password</label>
|
||||||
|
<input type="password" class="form-control required equalTo" required id="cpassword" name="cpassword" maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-2" style="display:block;">
|
||||||
|
<div class="form-group" style="display:none;">
|
||||||
<label for="role">Role</label>
|
<label for="role">Role</label>
|
||||||
<select class="form-control required" id="role" name="role">
|
<select class="form-control required" id="role" name="role">
|
||||||
<option value="0">Select Role</option>
|
<option value="0">Select Role</option>
|
||||||
@ -128,19 +144,6 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="password">Password</label>
|
|
||||||
<input type="password" class="form-control required" id="password" required name="password" maxlength="10">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-2">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="cpassword">Confirm Password</label>
|
|
||||||
<input type="password" class="form-control required equalTo" required id="cpassword" name="cpassword" maxlength="10">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -198,7 +201,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="text" name="txtSelectedDepartment" id="txtSelectedDepartment" />
|
<input type="hidden" name="txtSelectedDepartment" id="txtSelectedDepartment" />
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -220,6 +223,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$this->load->helper('form');
|
$this->load->helper('form');
|
||||||
$error = $this->session->flashdata('error');
|
$error = $this->session->flashdata('error');
|
||||||
|
|
||||||
|
echo $error;
|
||||||
if($error)
|
if($error)
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -189,7 +189,7 @@ $(function() {
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- <?php print_r($DepAccesslist);?> -->
|
<!-- <?php print_r($DepAccesslist);?> -->
|
||||||
<?php foreach($DepAccesslist as $dep){?>
|
<?php foreach($DepAccesslist as $dep){?>
|
||||||
|
|
||||||
<?php $assd=$dep->AssDep;
|
<?php $assd=$dep->AssDep;
|
||||||
@ -203,7 +203,7 @@ $(function() {
|
|||||||
<span>Purchase Order From Requisition</span>
|
<span>Purchase Order From Requisition</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?}}?>
|
<?} break;}?>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@ -357,7 +357,7 @@ $(function() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php $check=0; ?>
|
<?php $check=0; $check1=0; $check2=0;?>
|
||||||
<?php foreach($DepAccesslist as $dep){
|
<?php foreach($DepAccesslist as $dep){
|
||||||
$assd= $dep->AssDep;
|
$assd= $dep->AssDep;
|
||||||
|
|
||||||
@ -374,7 +374,7 @@ $(function() {
|
|||||||
$assd= $dep->AssDep;?>
|
$assd= $dep->AssDep;?>
|
||||||
|
|
||||||
|
|
||||||
<?php if($assd == ADMIN || $DEPCode == ADMIN){?>
|
<?php if($assd == ADMIN || $DEPCode == ADMIN){ $check1 =1;?>
|
||||||
|
|
||||||
<li class="treeview">
|
<li class="treeview">
|
||||||
<a href="<?php echo base_url(); ?>Addigr">
|
<a href="<?php echo base_url(); ?>Addigr">
|
||||||
@ -388,7 +388,7 @@ $(function() {
|
|||||||
<span>View Inward Gate Register</span>
|
<span>View Inward Gate Register</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
<?php if($assd == STORE || $assd == QUALITY || $DEPCode == STORE || $DEPCode ==QUALITY){?>
|
<?php if($assd == STORE || $assd == QUALITY || $DEPCode == STORE || $DEPCode ==QUALITY){?>
|
||||||
|
|
||||||
@ -429,7 +429,7 @@ $(function() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?}?>
|
<?} if($check1==1){break;}?>
|
||||||
|
|
||||||
<?}?>
|
<?}?>
|
||||||
</ul>
|
</ul>
|
||||||
@ -437,7 +437,7 @@ $(function() {
|
|||||||
<? if($check ==1){break;} }}?>
|
<? if($check ==1){break;} }}?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php foreach($DepAccesslist as $dep){
|
<?php foreach($DepAccesslist as $dep){
|
||||||
$assd= $dep->AssDep;?>
|
$assd= $dep->AssDep;?>
|
||||||
|
|||||||
@ -20,15 +20,15 @@ $(document).ready(function(){
|
|||||||
password : { required : true },
|
password : { required : true },
|
||||||
cpassword : {required : true, equalTo: "#password"},
|
cpassword : {required : true, equalTo: "#password"},
|
||||||
mobile : { required : true, digits : true },
|
mobile : { required : true, digits : true },
|
||||||
role : { required : true, selected : true}
|
|
||||||
},
|
},
|
||||||
messages:{
|
messages:{
|
||||||
fname :{ required : "This field is required" },
|
fname :{ required : "This field is required" },
|
||||||
email : { required : "This field is required", email : "Please enter valid email address", remote : "Email already taken" },
|
email : { required : "This field is required", email : "Please enter valid email address", remote : "Email already taken" },
|
||||||
password : { required : "This field is required" },
|
password : { required : "This field is required" },
|
||||||
cpassword : {required : "This field is required", equalTo: "Please enter same password" },
|
cpassword : {required : "This field is required", equalTo: "Please enter same password" },
|
||||||
mobile : { required : "This field is required", digits : "Please enter numbers only" },
|
mobile : { required : "This field is required", digits : "Please enter numbers only" }
|
||||||
role : { required : "This field is required", selected : "Please select atleast one option" }
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user