mirror of https://github.com/xevidos/codiad.git
Changed change_access to use id instead of event, Added check to see if updated is needed on user table access column.
This commit is contained in:
parent
fee5d1e869
commit
271a10abd3
|
@ -292,7 +292,7 @@ switch( $_GET['action'] ) {
|
|||
<p><?php echo htmlentities( $i["username"] );?></p>
|
||||
</td>
|
||||
<td>
|
||||
<select onchange="codiad.project.change_access( event );">
|
||||
<select onchange="codiad.project.change_access( <?php echo $i["id"];?> );">
|
||||
<?php
|
||||
foreach( Permissions::LEVELS as $level => $id ) {
|
||||
|
||||
|
|
|
@ -69,10 +69,9 @@
|
|||
});
|
||||
},
|
||||
|
||||
change_access: function( e ) {
|
||||
change_access: function( id ) {
|
||||
|
||||
let _this = codiad.project;
|
||||
let id = $( '#modal-content form select[name="user_list"]' ).val();
|
||||
let project_path = $( '#modal-content form input[name="project_path"]' ).val();
|
||||
let project_id = $( '#modal-content form input[name="project_id"]' ).val();
|
||||
let access = $( e.target ).children( "option:selected" ).val();
|
||||
|
|
|
@ -281,6 +281,21 @@ class sql {
|
|||
|
||||
$update_query = "";
|
||||
$users = $this->query( "SELECT id, access FROM users", array(), array(), "fetchAll", "exception" );
|
||||
$update = false;
|
||||
|
||||
foreach( $users as $row => $user ) {
|
||||
|
||||
if( ! is_numeric( $user["access"] ) ) {
|
||||
|
||||
$update = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( ! $update ) {
|
||||
|
||||
$users = array();
|
||||
}
|
||||
|
||||
foreach( $users as $row => $user ) {
|
||||
|
||||
|
@ -289,7 +304,7 @@ class sql {
|
|||
$access = Permissions::SYSTEM_LEVELS[$user["access"]];
|
||||
} elseif( is_numeric( $user["access"] ) ) {
|
||||
|
||||
continue;
|
||||
$access = $user["access"];
|
||||
} else {
|
||||
|
||||
$access = Permissions::SYSTEM_LEVELS["user"];
|
||||
|
|
Loading…
Reference in New Issue