Omejitev dodeljenih uporabnikov za managerje je zaenkrat onemogocena.

This commit is contained in:
pero1203 2021-01-25 09:03:17 +01:00
parent 483730305b
commit efd1f615ec
3 changed files with 34 additions and 33 deletions

View File

@ -8250,8 +8250,8 @@ class SurveyAdminSettings {
if( !($admin_type == 1 || $admin_type == 0) ) if( !($admin_type == 1 || $admin_type == 0) )
return ''; return '';
// Na virtualkah imajo managerji omejitev st. dodeljenih uporabnikov // Na virtualkah imajo managerji omejitev st. dodeljenih uporabnikov - ZAENKRAT JE TO ONEMOGOCENO, KASNEJE SE LAHKO OMEJI NA PAKET
if(/*$virtual_domain && */$admin_type == 1){ if(false && $virtual_domain && $admin_type == 1){
// Limit st. dodeljenih uporabnikov // Limit st. dodeljenih uporabnikov
$managed_accounts_limit = 5; $managed_accounts_limit = 5;
@ -8286,6 +8286,7 @@ class SurveyAdminSettings {
echo '<div id="dodajanje">'; echo '<div id="dodajanje">';
// Dodajanje novih uporabnikov - ustvari racun, doda uporabnika pod pregled in mu poslje mail
echo '<form class="manager_add_user" name="manager_add_user" action="ajax.php?t=dostop&a=manager_add_user" method="post">'; echo '<form class="manager_add_user" name="manager_add_user" action="ajax.php?t=dostop&a=manager_add_user" method="post">';
echo '<h3><b>'.$lang['srv_users_add_assigned_title'].'</b></h3>'; echo '<h3><b>'.$lang['srv_users_add_assigned_title'].'</b></h3>';
echo '<p><label for="email">'.$lang['email'].':</label><input type="email" id="email" name="email"> '.(empty($_GET['add']) && $_GET['error']=='email'?'<span class="red">'.$lang['srv_added_false'].'</span>':'').'</p>'; echo '<p><label for="email">'.$lang['email'].':</label><input type="email" id="email" name="email"> '.(empty($_GET['add']) && $_GET['error']=='email'?'<span class="red">'.$lang['srv_added_false'].'</span>':'').'</p>';
@ -8294,7 +8295,6 @@ class SurveyAdminSettings {
echo '<p><label for="password">'.$lang['password'].':</label><input type="password" id="password" name="password"> '.(empty($_GET['add']) && $_GET['error']=='pass'?'<span class="red">'.$lang['pass_doesnt_match'].'</span>':'').'</p>'; echo '<p><label for="password">'.$lang['password'].':</label><input type="password" id="password" name="password"> '.(empty($_GET['add']) && $_GET['error']=='pass'?'<span class="red">'.$lang['pass_doesnt_match'].'</span>':'').'</p>';
echo '<p><label for="password2">'.$lang['again'].':</label><input type="password" id="password2" name="password2"></p>'; echo '<p><label for="password2">'.$lang['again'].':</label><input type="password" id="password2" name="password2"></p>';
//echo '<p><button type="submit">'.$lang['add'].'</button></p>';
echo '<p><div class="buttonwrapper floatLeft">'; echo '<p><div class="buttonwrapper floatLeft">';
echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="document.manager_add_user.submit();">'.$lang['create_add'].'</a>'; echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="document.manager_add_user.submit();">'.$lang['create_add'].'</a>';
echo '</div></p>'; echo '</div></p>';

View File

@ -995,7 +995,8 @@ class Dostop {
'id' => $sqls->id, 'id' => $sqls->id,
'text' => $sqls->email.' - '.$sqls->name.' '.$sqls->surname 'text' => $sqls->email.' - '.$sqls->name.' '.$sqls->surname
]; ];
}else{ }
else{
foreach ($sqls as $user) { foreach ($sqls as $user) {
$json['results'][] = [ $json['results'][] = [
'id' => $user->id, 'id' => $user->id,
@ -1005,17 +1006,17 @@ class Dostop {
} }
echo json_encode($json); echo json_encode($json);
}
}elseif ($admin_type == 1){ elseif ($admin_type == 1){
$email = trim($_POST['uemail']); $email = trim($_POST['uemail']);
$user = sisplet_query("SELECT id, name, surname, email FROM users WHERE id NOT IN (SELECT user FROM srv_dostop_manage WHERE manager='".$global_user_id."') AND email NOT LIKE ('D3LMD-%') AND email NOT LIKE ('UNSU8MD-%') AND email='".$email."'"); $user = sisplet_query("SELECT id, name, surname, email FROM users WHERE id NOT IN (SELECT user FROM srv_dostop_manage WHERE manager='".$global_user_id."') AND email NOT LIKE ('D3LMD-%') AND email NOT LIKE ('UNSU8MD-%') AND email='".$email."'");
if(mysqli_num_rows($user) > 0) { if(mysqli_num_rows($user) > 0) {
echo 'success'; echo 'success';
}else{ }
else{
echo 'error'; echo 'error';
} }
} }
} }

10
composer.lock generated
View File

@ -1912,16 +1912,16 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "filp/whoops", "name": "filp/whoops",
"version": "2.9.1", "version": "2.9.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/filp/whoops.git", "url": "https://github.com/filp/whoops.git",
"reference": "307fb34a5ab697461ec4c9db865b20ff2fd40771" "reference": "df7933820090489623ce0be5e85c7e693638e536"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/307fb34a5ab697461ec4c9db865b20ff2fd40771", "url": "https://api.github.com/repos/filp/whoops/zipball/df7933820090489623ce0be5e85c7e693638e536",
"reference": "307fb34a5ab697461ec4c9db865b20ff2fd40771", "reference": "df7933820090489623ce0be5e85c7e693638e536",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1969,7 +1969,7 @@
"throwable", "throwable",
"whoops" "whoops"
], ],
"time": "2020-11-01 12:00:00" "time": "2021-01-24 12:00:00"
}, },
{ {
"name": "kint-php/kint", "name": "kint-php/kint",