summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.Dostop.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/class.Dostop.php')
-rw-r--r--admin/survey/classes/class.Dostop.php450
1 files changed, 292 insertions, 158 deletions
diff --git a/admin/survey/classes/class.Dostop.php b/admin/survey/classes/class.Dostop.php
index 883e7ce..a06e0d9 100644
--- a/admin/survey/classes/class.Dostop.php
+++ b/admin/survey/classes/class.Dostop.php
@@ -37,7 +37,6 @@ class Dostop {
if ($anketa == 0) {
$anketa = $this->anketa;
}
- $uid = $global_user_id;
SurveyInfo::getInstance()->SurveyInit($anketa);
$rowa = SurveyInfo::getInstance()->getSurveyRow();
@@ -48,19 +47,19 @@ class Dostop {
}
// za demonstracijsko je posebno preverjanje
- if ($rowa['invisible'] == 1) {
+ if (isDemoSurvey($anketa)) {
return TRUE;
}
// posebej dostop za vsazga userja posebej
- $sql = sisplet_query("SELECT ank_id, uid FROM srv_dostop WHERE ank_id = '$anketa' AND uid='$uid'");
+ $sql = sisplet_query("SELECT ank_id, uid FROM srv_dostop WHERE ank_id = '$anketa' AND uid='$global_user_id'");
if (mysqli_num_rows($sql) > 0) {
return TRUE;
}
// dodatno imamo se ce je manager ali admin, potem vidi ankete podrejenih userjev
if ($admin_type == 1 || $admin_type == 0) {
- $sql = sisplet_query("SELECT COUNT(*) FROM srv_dostop WHERE ank_id='$anketa' AND uid IN (SELECT user FROM srv_dostop_manage WHERE manager='$uid')");
+ $sql = sisplet_query("SELECT COUNT(*) FROM srv_dostop WHERE ank_id='$anketa' AND uid IN (SELECT user FROM srv_dostop_manage WHERE manager='$global_user_id')");
$row = mysqli_fetch_array($sql);
if ($row[0] > 0) {
return TRUE;
@@ -76,24 +75,28 @@ class Dostop {
}
/**
- * Kao meta admin, ki vidi vse
+ * Meta admin, ki vidi vse ankete
*/
- static function isMetaAdmin()
- {
- global $global_user_id;
+ static function isMetaAdmin(){
+ global $global_user_id;
global $admin_type;
- global $mysql_database_name;
- // Samo na www in virtualkah
- if(($mysql_database_name == 'www1kasi' || $mysql_database_name == 'real1kasi') && $admin_type == '0'){
- // vvasja@gmail.com - id: 100, peter.h1203@gmail.com - id: 12611, 1ka.techsupport - id: 49089 (virtualke), 72253
- if (in_array($global_user_id, [100, 12611, 49089, 72253])) {
+ // Ce ni admin ni nikoli metaadmin
+ if($admin_type != '0'){
+ return FALSE;
+ }
+
+ $meta_admin_ids = AppSettings::getInstance()->getSetting('meta_admin_ids');
+
+ // Ce imamo nastavljene id-je za metaadmine v settings_optional
+ if(isset($meta_admin_ids) && !empty($meta_admin_ids)){
+
+ if (in_array($global_user_id, $meta_admin_ids)) {
return TRUE;
}
- }
-
+ }
// Gorenje ima svoje metaadmine
- if ($admin_type == '0' && Common::checkModule('gorenje')){
+ elseif(Common::checkModule('gorenje')){
global $meta_admin_emails;
$sql = sisplet_query("SELECT email FROM users WHERE id = '$global_user_id'");
@@ -130,15 +133,13 @@ class Dostop {
*
* @param mixed $anketa
*/
- function checkDostopSub($type, $anketa = 0)
- {
+ public function checkDostopSub($type, $anketa = 0){
global $admin_type;
global $global_user_id;
if ($anketa == 0) {
$anketa = $this->anketa;
}
- $uid = $global_user_id;
SurveyInfo::getInstance()->SurveyInit($anketa);
$rowa = SurveyInfo::getInstance()->getSurveyRow();
@@ -149,17 +150,28 @@ class Dostop {
}
// za demonstracijsko je posebno preverjanje
- if ($rowa['invisible'] == 1) {
+ if (isDemoSurvey($anketa)) {
+ return TRUE;
+ }
+
+ // ce je avtor ima vedno dostop do vsega
+ if ($global_user_id == $rowa['insert_uid']) {
return TRUE;
}
- $sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id = '$anketa' AND uid='$uid'");
+
+ $sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id = '$anketa' AND uid='$global_user_id'");
if (mysqli_num_rows($sql) > 0) {
$row = mysqli_fetch_array($sql);
$dostop = explode(',', $row['dostop']);
if (in_array($type, $dostop)) {
- return TRUE;
+
+ // Odklepanje anekte - vrne ravno obratno
+ if($type == 'lock')
+ return FALSE;
+ else
+ return TRUE;
}
// managerji in admini majo vedno lepe linke in maile
@@ -170,7 +182,7 @@ class Dostop {
// administratorji in managerji imajo do max kar imajo njegovi podrejeni userji
if ($admin_type <= 1) {
- $sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id='$anketa' AND uid IN (SELECT user FROM srv_dostop_manage WHERE manager='$uid')");
+ $sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id='$anketa' AND uid IN (SELECT user FROM srv_dostop_manage WHERE manager='$global_user_id')");
while ($row = mysqli_fetch_array($sql)) {
$dostop = explode(',', $row['dostop']);
@@ -190,82 +202,138 @@ class Dostop {
return TRUE;
}
- return FALSE;
+ // Odklepanje anekte - vrne ravno obratno
+ if($type == 'lock')
+ return TRUE;
+ else
+ return FALSE;
}
+ public function checkDostopSubFromNavigation($navigation){
+ global $admin_type;
+ global $global_user_id;
+
+ if ($navigation == NAVI_STATUS) {
+ $type = 'dashboard';
+ }
+ elseif ($navigation == NAVI_UREJANJE) {
+ if ($_GET['a'] == 'telephone')
+ $type = 'phone';
+ else
+ $type = 'edit';
+ }
+ elseif ($navigation == NAVI_TESTIRANJE) {
+ $type = 'test';
+ }
+ elseif ($navigation == NAVI_OBJAVA) {
+ $type = 'publish';
+ }
+ elseif ($navigation == NAVI_RESULTS && $_GET['m'] != 'monitoring') {
+ $type = 'data';
+ }
+ elseif ($navigation == NAVI_ANALYSIS) {
+ $type = 'analyse';
+ }
+ else{
+ return TRUE;
+ }
+
+ return $this->checkDostopSub($type);
+ }
+
+ // Izposemo obvestilo, da urednik nima dostopa do podstrani
+ public function displayDostopNoAccess($what=''){
+ global $lang;
+ global $site_url;
+
+ echo '<div class="user_dostop_sub_warning">';
+
+ echo ' <div class="no_access_title"> <span class="faicon lock_close yellow"></span>'.$lang['srv_dostop_sub_locked_title'].'</div>';
+
+ echo ' <div class="no_access_stavki">';
+ echo ' <p>'.$lang['srv_dostop_sub_locked_text'].'</p>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+
function ajax(){
- if ($_GET['a'] == 'manager_add_user') {
+ $a = isset($_GET['a']) ? $_GET['a'] : '';
+ $m = isset($_GET['m']) ? $_GET['m'] : '';
+
+ if ($a == 'manager_add_user') {
$this->ajax_manager_add_user();
}
- elseif($_GET['a'] == 'add_new_user'){
+ elseif($a == 'add_new_user'){
$this->ajax_add_new_user();
}
- elseif ($_GET['a'] == 'anketa_user_dostop') {
+ elseif ($a == 'anketa_user_dostop') {
$this->ajax_anketa_user_dostop();
}
- elseif ($_GET['a'] == 'anketa_user_dostop_save') {
+ elseif ($a == 'anketa_user_dostop_save') {
$this->ajax_anketa_user_dostop_save();
}
- elseif ($_GET['a'] == 'edit_user') {
+ elseif ($a == 'edit_user') {
$this->ajax_edit_user();
}
- elseif ($_GET['a'] == 'edit_user_save') {
+ elseif ($a == 'edit_user_save') {
$this->ajax_edit_user_save();
}
- elseif ($_GET['a'] == 'admin_add_user') {
+ elseif ($a == 'admin_add_user') {
$this->ajax_admin_add_user();
}
- elseif ($_GET['a'] == 'admin_add_user_popup') {
+ elseif ($a == 'admin_add_user_popup') {
$this->ajax_admin_add_user_popup();
}
- elseif($_GET['a'] == 'find_user'){
+ elseif($a == 'find_user'){
$this->ajax_find_user();
}
- elseif ($_GET['a'] == 'edit_remove_user') {
+ elseif ($a == 'edit_remove_user') {
$this->ajax_edit_remove_user();
}
- elseif ($_GET['a'] == 'edit_remove_user_manager') {
+ elseif ($a == 'edit_remove_user_manager') {
$this->ajax_edit_remove_user_manager();
}
- elseif ($_GET['a'] == 'edit_remove_user_admin') {
+ elseif ($a == 'edit_remove_user_admin') {
$this->ajax_edit_remove_user_admin();
}
- elseif ($_GET['a'] == 'all_users_list') {
+ elseif ($a == 'all_users_list') {
- if ($_GET['m'] == 'delete') {
+ if ($m == 'delete') {
$this->ajax_all_users_list_delete();
}
- if ($_GET['m'] == 'ban') {
+ if ($m == 'ban') {
$this->ajax_all_users_list_ban();
}
else {
$this->ajax_all_users_list();
}
}
- elseif($_GET['a'] == 'my_users_list'){
+ elseif($a == 'my_users_list'){
$this->ajax_all_users_list_my();
}
- elseif ($_GET['a'] == 'delete_users_list') {
+ elseif ($a == 'delete_users_list') {
$this->ajax_delete_users_list();
}
- elseif ($_GET['a'] == 'unsigned_users_list') {
+ elseif ($a == 'unsigned_users_list') {
$this->ajax_unsigned_users_list();
}
- elseif ($_GET['a'] == 'unconfirmed_mail_user_list') {
+ elseif ($a == 'unconfirmed_mail_user_list') {
- if ($_GET['m'] == 'delete') {
+ if ($m == 'delete') {
$this->ajax_unconfirmed_mail_user_list_delet_user();
}
- elseif ($_GET['m'] == 'accept') {
+ elseif ($m == 'accept') {
$this->ajax_confirm_user_email();
}
else {
$this->ajax_unconfirmed_mail_user_list();
}
}
- elseif ($_GET['a'] == 'dodeljeni_uporabniki_display') {
+ elseif ($a == 'dodeljeni_uporabniki_display') {
$this->ajax_dodeljeni_uporabniki_display();
}
}
@@ -275,7 +343,7 @@ class Dostop {
*/
public function ajax_add_new_user()
{
- global $pass_salt, $site_url, $site_domain, $virtual_domain, $lang, $app_settings;
+ global $pass_salt, $site_url, $site_domain, $lang;
$email = $_POST['email'];
$name = $_POST['name'];
@@ -286,6 +354,7 @@ class Dostop {
include root_dir('lang/'.$jezik.'.php');
+ $error = '';
if ($email != '') {
@@ -294,7 +363,7 @@ class Dostop {
if ($password == '' || $password == $password2) {
- $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from, lang) VALUES ('$name', '$surnname', '$email', '" . base64_encode((hash(SHA256, $password . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1', $jezik)");
+ $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from, lang) VALUES ('$name', '$surnname', '$email', '" . base64_encode((hash('SHA256', $password . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1', $jezik)");
$id = mysqli_insert_id($GLOBALS['connect_db']);
} else {
@@ -317,26 +386,24 @@ class Dostop {
$UserContent .= $lang['register_add_user_content_edit'];
- $PageName = $app_settings['app_name'];
+ $PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
$change = '<a href="'.$site_url.'admin/survey/index.php?a=nastavitve&m=global_user_myProfile">';
- $out = '<a href="'.$this->page_urls['page_unregister'].'?email='.$email.'">';
// Ce gre slucajno za virtualko
- $Subject = ($virtual_domain) ? $lang['register_user_subject_virtual'] : $lang['register_user_subject'];
+ $Subject = (isVirtual()) ? $lang['register_user_subject_virtual'] : $lang['register_user_subject'];
$UserContent = str_replace("SFNAME", $name, $UserContent);
$UserContent = str_replace("SFMAIL", $email, $UserContent);
$UserContent = str_replace("SFWITH", $email, $UserContent);
$UserContent = str_replace("SFPAGENAME", $PageName, $UserContent);
$UserContent = str_replace("SFCHANGE", $change, $UserContent);
- $UserContent = str_replace("SFOUT", $out, $UserContent);
$UserContent = str_replace("SFEND", '</a>', $UserContent);
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
// Ce gre slucajno za virtualko
- if($virtual_domain)
+ if(isVirtual())
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
if ($password2 == "") {
@@ -384,7 +451,7 @@ class Dostop {
$error = 'email';
}
- header("Location: index.php?a=diagnostics&t=uporabniki&m=all&add=new&error=" . ($error !== FALSE ? $error : ''));
+ header("Location: index.php?a=diagnostics&t=uporabniki&m=all&add=new&error=".$error);
}
/**
@@ -411,6 +478,8 @@ class Dostop {
$password = $_POST['password'];
$password2 = $_POST['password2'];
+ $error = '';
+
if ($email != '') {
$sqlu = sisplet_query("SELECT id FROM users WHERE email='$email'");
@@ -418,7 +487,7 @@ class Dostop {
if ($password == '' || $password == $password2) {
- $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surnname', '$email', '" . base64_encode((hash(SHA256, $password . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')");
+ $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surnname', '$email', '" . base64_encode((hash('SHA256', $password . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')");
$id = mysqli_insert_id($GLOBALS['connect_db']);
} else {
@@ -473,7 +542,7 @@ class Dostop {
$error = 'email';
}
- header("Location: index.php?a=diagnostics&t=uporabniki&m=my&error=" . ($error !== FALSE ? $error : ''));
+ header("Location: index.php?a=diagnostics&t=uporabniki&m=my&error=".$error);
}
/**
@@ -497,7 +566,8 @@ class Dostop {
echo '<div class="popup_close"><a href="#" onClick="anketa_user_dostop_close(); return false;">✕</a></div>';
- echo '<h3><span class="bold">';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title semi-bold">';
if ($r['type'] == 2 || $r['type'] == 3) {
echo $lang['admin_narocnik'];
@@ -511,7 +581,7 @@ class Dostop {
$r['email'] = iconv("iso-8859-2", "utf-8", $r['email']);
- echo ': ' . $r['name'] . ' ' . $r['surname'] . ' (' . $r['email'] . ')</span></h3>';
+ echo ': ' . $r['name'] . ' ' . $r['surname'] . ' (' . $r['email'] . ')</span>';
if ($r['type'] >= 2) {
@@ -520,49 +590,77 @@ class Dostop {
$dostop = explode(',', $row['dostop']);
echo '<form id="dostop">';
echo '<input type="hidden" name="uid" value="' . $uid . '">';
-
echo '<input type="hidden" name="aktiven" value="1" id="aktiven_1">';
- echo '<p><input type="checkbox" name="dostop[dashboard]" value="dashboard" id="dashboard" ' . (in_array('dashboard', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="dashboard">' . $lang['srv_dostop_dashboard'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[edit]" value="edit" id="edit" ' . (in_array('edit', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);"> <label for="edit">' . $lang['srv_dostop_edit'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[test]" value="test" id="test" ' . (in_array('test', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);"> <label for="test">' . $lang['srv_dostop_test'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[publish]" value="publish" id="publish" ' . (in_array('publish', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);"> <label for="publish">' . $lang['srv_dostop_publish'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[data]" value="data" id="data" ' . (in_array('data', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="data">' . $lang['srv_dostop_data'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[analyse]" value="analyse" id="analyse" ' . (in_array('analyse', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="analyse">' . $lang['srv_dostop_analyse'] . '</label></p>';
-
- echo '<p><input type="checkbox" name="dostop[export]" value="export" id="export" ' . (in_array('export', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="export">' . $lang['srv_dostop_export'] . '</label></p>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[dashboard]" value="dashboard" id="dashboard" ' . (in_array('dashboard', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="dashboard">' . $lang['srv_dostop_dashboard'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[edit]" value="edit" id="edit" ' . (in_array('edit', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);">';
+ echo '<label for="edit">' . $lang['srv_dostop_edit'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[test]" value="test" id="test" ' . (in_array('test', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);">';
+ echo '<label for="test">' . $lang['srv_dostop_test'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[publish]" value="publish" id="publish" ' . (in_array('publish', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);">';
+ echo '<label for="publish">' . $lang['srv_dostop_publish'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[data]" value="data" id="data" ' . (in_array('data', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="data">' . $lang['srv_dostop_data'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[analyse]" value="analyse" id="analyse" ' . (in_array('analyse', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="analyse">' . $lang['srv_dostop_analyse'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[export]" value="export" id="export" ' . (in_array('export', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="export">' . $lang['srv_dostop_export'] . '</label>';
+ echo '</div>';
// Nastavitev, da ne more odklenit ankete
- echo '<p><input type="checkbox" name="dostop[lock]" value="lock" id="lock" ' . (in_array('lock', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="lock">' . $lang['srv_dostop_lock'] . '</label></p>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[lock]" value="lock" id="lock" ' . (in_array('lock', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="lock">' . $lang['srv_dostop_lock'] . '</label>';
+ echo '</div>';
// Je anketar - ne more poceti nicesar razen izvajati telefonsko anketo (ob kliku se ostale avtomatsko ugasnejo in disablajo)
- echo '<p><input type="checkbox" name="dostop[phone]" value="phone" id="phone" ' . (in_array('phone', $dostop) ? 'checked' : '') . ' onchange="dostop_anketar(this);"> <label for="phone">' . $lang['srv_dostop_phone'] . '</label></p>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[phone]" value="phone" id="phone" ' . (in_array('phone', $dostop) ? 'checked' : '') . ' onchange="dostop_anketar(this);">';
+ echo '<label for="phone">' . $lang['srv_dostop_phone'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
// Če gre za Hierarhijo
if (SurveyInfo::checkSurveyModule('hierarhija', $this->anketa)) {
$tip = sisplet_query("SELECT type FROM srv_hierarhija_users WHERE user_id='" . $uid . "' AND anketa_id='" . $this->anketa . "'", "obj");
if (!empty($tip) && !empty($tip->type)) {
- echo '<p><label>Uporabnik hierarhije s pravicami: </label>';
- echo '<select name="hierarchy_type" id="hierarchy-type-change" onchange="hierarhijaPravice()">
- <option value="10" ' . ($tip->type == 10 ? 'selected' : NULL) . '> Učitelj </option>
- <option value="2" ' . ($tip->type == 2 ? 'selected' : NULL) . '> Administrator </option>
- </select ></p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">Uporabnik hierarhije s pravicami:</span>';
+ echo '<select class="dropdown large" name="hierarchy_type" id="hierarchy-type-change" onchange="hierarhijaPravice()">
+ <option value="10" ' . ($tip->type == 10 ? 'selected' : NULL) . '> Učitelj </option>
+ <option value="2" ' . ($tip->type == 2 ? 'selected' : NULL) . '> Administrator </option>
+ </select >';
+ echo '</div>';
}
}
-
- echo '<div style="position: absolute; right: 10px; top: 50px; width: 200px;">';
-
// Ce je katerikoli od treh checkboxou ugasnjen imamo enablano editiranje samo posameznega jezik
$enable_lang = (!in_array('edit', $dostop) || !in_array('test', $dostop) || !in_array('publish', $dostop)) ? TRUE : FALSE;
$sqll = sisplet_query("SELECT * FROM srv_language WHERE ank_id = '$this->anketa'");
- if (mysqli_num_rows($sqll) > 0) {
- echo '<p><b>' . $lang['srv_passive_multilang'] . '</b></p>';
+ echo '<div class="setting_holder">';
+
+ if (mysqli_num_rows($sqll) > 0) {
+ echo '<span class="setting_title">' . $lang['srv_passive_multilang'] . ':</span>';
+
echo '<input type="hidden" name="dostop_language_edit" id="dostop_language_edit" value="' . ($enable_lang ? '1' : '0') . '">';
}
+
while ($rowl = mysqli_fetch_array($sqll)) {
$sqldl = sisplet_query("SELECT * FROM srv_dostop_language WHERE ank_id = '$this->anketa' AND uid = '$uid' AND lang_id='$rowl[lang_id]'");
@@ -575,16 +673,18 @@ class Dostop {
$checked = '';
}
- echo '<label><input class="dostop_language" type="checkbox" name="dostop_language[]" value="' . $uid . '-' . $rowl['lang_id'] . '" ' . $checked . ' ' . ($enable_lang ? '' : ' disabled="disabled"') . ' > ' . $rowl['language'] . '</label> <br>';
+ echo '<div class="setting_item">';
+ echo '<input class="dostop_language" type="checkbox" name="dostop_language[]" id="' . $uid . '-' . $rowl['lang_id'] . '" value="' . $uid . '-' . $rowl['lang_id'] . '" ' . $checked . ' ' . ($enable_lang ? '' : ' disabled') . ' >';
+ echo '<label ' . ($enable_lang ? '' : ' disabled') . ' for="' . $uid . '-' . $rowl['lang_id'] . '">' . $rowl['language'] . '</label>';
+ echo '</div>';
}
echo '</div>';
echo '</form>';
-
- echo '<div class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_orange" onclick="anketa_user_dostop_save(\'' . $this->anketa . '\'); return false;" href="#"><span>' . $lang['edit1337'] . '</span></a></div>';
}
- // Manager - brez moznosti uporabe 1ka streznika
+
+ // Manager - brez moznosti uporabe 1ka streznika
elseif ($r['type'] == 1) {
$sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id='$this->anketa' AND uid='$uid'");
@@ -629,8 +729,6 @@ class Dostop {
echo '</form>';
echo '<p>(' . $lang['srv_dostop_edit'] . ', ' . $lang['srv_dostop_data'] . ', ' . $lang['srv_dostop_export'] . ')</p>';
-
- echo '<div class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_orange" onclick="anketa_user_dostop_save(\'' . $this->anketa . '\'); return false;" href="#"><span>' . $lang['edit1337'] . '</span></a></div>';
}
// Ostali ne morejo managerju nicesar spreminjati
else {
@@ -642,7 +740,10 @@ class Dostop {
echo '<p>(' . $lang['srv_dostop_edit'] . ', ' . $lang['srv_dostop_data'] . ', ' . $lang['srv_dostop_export'] . ')</p>';
}
- echo '<div class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_gray" onclick="anketa_user_dostop_close(); return false;" href="#"><span>' . $lang['srv_zapri'] . '</span></a></div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="anketa_user_dostop_close(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="anketa_user_dostop_save(\'' . $this->anketa . '\'); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
}
function ajax_anketa_user_dostop_save() {
@@ -680,7 +781,6 @@ class Dostop {
global $lang;
global $global_user_id;
global $admin_type;
- global $virtual_domain;
$uid = $_POST['uid'];
@@ -694,7 +794,8 @@ class Dostop {
echo '<form class="manager_add_user" name="manager_edit_user" action="ajax.php?t=dostop&a=edit_user_save&uid=' . $uid . '" method="post">';
- echo '<h2><strong>' . $lang['edit_user'] . '</strong></h2>';
+ echo '<h2>' . $lang['edit_user'] . '</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="edit_user_close();">✕</a></div>';
// Segment tip uporabnika
echo '<div class="segment user_type">';
@@ -703,35 +804,65 @@ class Dostop {
// Emaila ne more vec editirat, ker je prevec problemov (izgubi ankete...)
echo '<input type="hidden" id="email" name="email" value="' . $row['email'] . '" />';
- echo '<p><label for="email">' . $lang['user2'] . ':</label>'.$row['name'].' '.$row['surname'].' ('.$row['email'].')</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">' . $lang['user2'] . ': '.$row['name'].' '.$row['surname'].' ('.$row['email'].')</span>';
+ echo '</div>';
// Admin lahko spreminja tip vseh userjev
if ($admin_type == 0) {
- echo '<p><label for="type">' . $lang['admin_type'] . '</label><select id="type" name="type">';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['admin_type'] . ':</span>';
+ echo '<select class="dropdown medium" id="type" name="type">';
echo '<option value="0" ' . ($row['type'] == '0' ? 'selected' : '') . '>' . $lang['admin_admin'] . '</option>';
echo '<option value="1" ' . ($row['type'] == '1' ? 'selected' : '') . '>' . $lang['admin_manager'] . '</option>';
echo '<option value="3" ' . ($row['type'] == '3' ? 'selected' : '') . '>' . $lang['admin_narocnik'] . '</option>';
- echo '</select></p>';
+ echo '</select>';
+ echo '</div>';
}
else {
echo '<input type="hidden" id="type" name="type" value="' . $row['type'] . '" />';
}
- echo '<p><label for="status">' . $lang['status'] . '</label><select name="status" id="status"><option value="1" ' . ($row['status'] == 1 ? 'selected' : '') . '>' . $lang['srv_user_notbanned'] . '</option><option value="0" ' . ($row['status'] == 0 ? 'selected' : '') . '>' . $lang['srv_user_banned'] . '</option></select></p>';
-
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['status'] . '</span>';
+ echo '<select class="dropdown medium" name="status" id="status"><option value="1" ' . ($row['status'] == 1 ? 'selected' : '') . '>' . $lang['srv_user_notbanned'] . '</option><option value="0" ' . ($row['status'] == 0 ? 'selected' : '') . '>' . $lang['srv_user_banned'] . '</option></select>';
+ echo '</div>';
+
echo '</div>';
// Segment osnovni podatki
echo '<div class="segment user_info">';
- echo '<p><label for="name">' . $lang['name'] . ':</label><input type="text" id="name" name="name" value="' . (!empty($row['name']) ? $row['name'] : '') . '" autocomplete="off" size="50"></p>';
- echo '<p><label for="surname">' . $lang['surname'] . ':</label><input type="text" id="surname" name="surname" value="' . (!empty($row['surname']) ? $row['surname'] : '') . '" size="50" readonly onfocus="this.removeAttribute(\'readonly\');"></p>';
- echo '<p><label for="password">' . $lang['password'] . ':</label><input type="password" id="password" name="password" readonly onfocus="this.removeAttribute(\'readonly\');"></p>';
- echo '<p><label for="password2">' . $lang['cms_register_user_repeat_password'] . ':</label><input type="password" id="password2" name="password2" readonly onfocus="this.removeAttribute(\'readonly\');"></p>';
- echo '<p><label for="subscription">'.$lang['srv_subscribe'].':</label>
- <input type="radio" id="subscriptionDa" name="gdpr_agree" value="1" '.($row['gdpr_agree'] == 1 ? 'checked="checked"' : '').'><label for="subscriptionDa" style="width: auto;">'.$lang['yes'].'</label>'.
- ' <input type="radio" id="subscriptionNe" class="spaceLeft" name="gdpr_agree" value="0" '.($row['gdpr_agree'] == 0 ? 'checked="checked"' : '').'><label for="subscriptionNe" style="width: auto;">'.$lang['no'].'</label>'.
- '</p>';
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['name'] . ':</span>';
+ echo '<input type="text" class="text medium" id="name" name="name" value="' . (!empty($row['name']) ? $row['name'] : '') . '" autocomplete="off" size="50">';
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['surname'] . ':</span>';
+ echo '<input type="text" class="text medium" id="surname" name="surname" value="' . (!empty($row['surname']) ? $row['surname'] : '') . '" size="50" readonly onfocus="this.removeAttribute(\'readonly\');">';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['password'] . ':</span>';
+ echo '<input type="password" class="text medium" id="password" name="password" readonly onfocus="this.removeAttribute(\'readonly\');">';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['cms_register_user_repeat_password'] . ':</span>';
+ echo '<input type="password" class="text medium" id="password2" name="password2" readonly onfocus="this.removeAttribute(\'readonly\');">';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">'.$lang['srv_subscribe'].':</span>';
+ echo '<input type="radio" id="subscriptionDa" name="gdpr_agree" value="1" '.($row['gdpr_agree'] == 1 ? 'checked="checked"' : '').'><label for="subscriptionDa" style="width: auto;">'.$lang['yes'].'</label>'.
+ ' <input type="radio" id="subscriptionNe" class="spaceLeft" name="gdpr_agree" value="0" '.($row['gdpr_agree'] == 0 ? 'checked="checked"' : '').'><label for="subscriptionNe" style="width: auto;">'.$lang['no'].'</label>';
+ echo '</div>';
$user_2fa_validate = User::option($uid, 'google-2fa-validation');
if($admin_type == 0 && !empty($user_2fa_validate) && $user_2fa_validate != 'NOT') {
@@ -754,19 +885,20 @@ class Dostop {
}
// Na virtualkah manager ne sme odstraniti uporabnika iz pregleda (zaradi omejitve)
- if($admin_type != '1' || !$virtual_domain){
+ if($admin_type != '1' || !isVirtual()){
$sqlu = sisplet_query("SELECT * FROM srv_dostop_manage WHERE manager='$global_user_id' AND user='$uid'");
if (mysqli_num_rows($sqlu) > 0) {
- echo '<br /><p><a href="ajax.php?t=dostop&a=edit_remove_user&uid=' . $uid . '" onclick="if ( confirm(\'?\')) { } else {return false;}">' . $lang['srv_manager_rem_user2'] . '</a></p>';
+ echo '<div class="setting_holder horizontal">';
+ echo '<a href="ajax.php?t=dostop&a=edit_remove_user&uid='.$uid.'"><button class="small blue" onclick="if ( confirm(\'?\')) { } else {return false;}">'.$lang['srv_manager_rem_user2'].'</button></a>';
+ echo '</div>';
}
}
echo '</div>';
// Segment paket
- global $app_settings;
- if($app_settings['commercial_packages'] == true){
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
echo '<div class="segment user_package">';
$userAccess = UserAccess::getInstance($uid);
@@ -776,20 +908,20 @@ class Dostop {
$time_expire = (isset($userAccess_data['time_expire'])) ? date('d.m.Y', strtotime($userAccess_data['time_expire'])) : '';
// Paket
- echo '<p>';
- echo ' <label for="package">' . $lang['srv_access_package'] . ':</label>';
- echo ' <select name="package" id="package">';
+ echo '<div class="setting_holder horizontal">';
+ echo ' <span class="setting_title">' . $lang['srv_access_package'] . ':</span>';
+ echo ' <select name="package" id="package" class="dropdown medium">';
foreach($userAccess->getPackages() as $package_id => $package){
echo ' <option value="'.$package_id.'" '.($package_id == $active_package ? 'selected="selected"' : '').'>'.$package['name'].'</option>';
}
echo ' </select>';
- echo '</p>';
+ echo '</div>';
// Trajanje paketa
- echo '<p>';
- echo ' <label for="package_expire">' . ucfirst($lang['srv_access_package_valid']) . ':</label>';
- echo ' <input type="text" name="package_expire" id="package_expire" value="'.$time_expire.'" style="width:80px;">';
- echo '</p>';
+ echo '<div class="setting_holder horizontal">';
+ echo ' <span class="setting_title">' . ucfirst($lang['srv_access_package_valid']) . ':</span>';
+ echo ' <input type="text" name="package_expire" id="package_expire" value="'.$time_expire.'" class="medium">';
+ echo '</div>';
echo '
<script type="text/javascript">
@@ -807,7 +939,7 @@ class Dostop {
// SEZNAM ANKET
echo '<div class="survey_list">';
- echo ' <h3><strong>' . $lang['srv_ankete'] . '</strong></h3>';
+ echo ' <p class="semi-bold">' . $lang['srv_ankete'] . '</p>';
echo ' <ul>';
$sql = sisplet_query("SELECT srv_anketa.id, srv_anketa.naslov FROM srv_dostop, srv_anketa WHERE srv_dostop.uid='". $uid ."' AND srv_dostop.ank_id=srv_anketa.id ORDER BY srv_anketa.edit_time DESC");
@@ -822,10 +954,11 @@ class Dostop {
// GUMBI NA DNU
- echo '<p>';
- echo ' <div class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_gray" href="#" onclick="edit_user_close();"><span>'.$lang['srv_zapri'].'</span></a></div>';
- echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.manager_edit_user.submit();"><span>'.$lang['edit1337'].'</span></a></div>';
- echo '</p>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="edit_user_close();">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="document.manager_edit_user.submit();">'.$lang['edit1337'].'</button>';
+ echo '</div>';
}
function ajax_edit_user_save(){
@@ -1135,8 +1268,9 @@ class Dostop {
" WHERE u.email NOT LIKE ('D3LMD-%') AND u.email NOT LIKE ('UNSU8MD-%') ".$iskanjeSql;
// Filtri, ki jih datatables pošilja in po katerih filtriramo
- if($_POST['order'][0]['column'] < 12) {
+ if($_POST['order'][0]['column'] < 13) {
$orderPolje = [
+ "u.name",
"u.name ".$_POST['order'][0]['dir'].", u.surname",
"u.email",
"u.type",
@@ -1184,6 +1318,9 @@ class Dostop {
foreach ($vsi as $uporabnik) {
$seznam[] = [
+ '<a href="#" onclick="edit_user(\''.$uporabnik->id.'\'); return false;" title="'.$lang['srv_info_modify'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a>'.
+ '<span class="gray"> | </span><a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'ban\'); return false;" title="'.$lang[($uporabnik->status == 0 ? 'srv_user_banned' : 'srv_user_notbanned')].'"><i class="fa fa-ban '.($uporabnik->status == 0 ? 'red' : 'link-sv-moder').'"></i></a>'.
+ '<span class="gray"> | </span><a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'delete\'); return false;" title="'.$lang['srv_multicrosstabs_tables_delete_short'].'"><i class="fa fa-times link-sv-moder"></i></a>',
iconv(mb_detect_encoding( $uporabnik->name, mb_detect_order(), true), "UTF-8", $uporabnik->name) .' '.iconv(mb_detect_encoding( $uporabnik->surname, mb_detect_order(), true), "UTF-8", $uporabnik->surname),
(!empty($uporabnik->second_email) ? iconv(mb_detect_encoding( $uporabnik->second_email, mb_detect_order(), true), "UTF-8", $uporabnik->second_email) : iconv(mb_detect_encoding( $uporabnik->email, mb_detect_order(), true), "UTF-8", $uporabnik->email)),
$this->userTypeToText($uporabnik->type),
@@ -1195,10 +1332,7 @@ class Dostop {
(!empty($uporabnik->st_managerjev) ? $uporabnik->st_managerjev : 0),
$lang["users_gdpr".$uporabnik->gdpr_agree],
$uporabnik->registriran,
- $uporabnik->last_login,
- '<a href="#" onclick="edit_user(\''.$uporabnik->id.'\'); return false;" title="'.$lang['srv_info_modify'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a>'.
- ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'ban\'); return false;" title="'.$lang[($uporabnik->status == 0 ? 'srv_user_banned' : 'srv_user_notbanned')].'"><i class="fa fa-ban '.($uporabnik->status == 0 ? 'link-rdec' : 'link-sv-moder').'"></i></a>'.
- ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'delete\'); return false;" title="'.$lang['srv_multicrosstabs_tables_delete_short'].'"><i class="fa fa-times link-sv-moder"></i></a>'
+ $uporabnik->last_login
];
}
}
@@ -1213,7 +1347,7 @@ class Dostop {
// Število filtriranih zadetkov
$recordFiltered = $recordsTotal;
- if(!empty($_POST['search']['value']))
+ if(!empty($_POST['search']['value']) && is_countable($vsi))
$recordFiltered = sizeof($vsi);
echo json_encode([
@@ -1262,8 +1396,9 @@ class Dostop {
// Filtri, ki jih datatables pošilja in po katerih filtriramo
- if($_POST['order'][0]['column'] < 10) {
+ if($_POST['order'][0]['column'] < 11) {
$orderPolje = [
+ "u.name",
"u.name ".$_POST['order'][0]['dir'].", u.surname",
"u.email",
"u.type",
@@ -1309,6 +1444,9 @@ class Dostop {
foreach ($vsi as $uporabnik) {
$seznam[] = [
+ '<a href="#" onclick="edit_user(\''.$uporabnik->id.'\'); return false;" title="'.$lang['srv_info_modify'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a>'.
+ ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'ban\'); return false;" title="'.$lang[($uporabnik->status == 0 ? 'srv_user_banned' : 'srv_user_notbanned')].'"><i class="fa fa-ban '.($uporabnik->status == 0 ? 'red' : 'link-sv-moder').'"></i></a>'.
+ ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'delete\'); return false;" title="'.$lang['srv_multicrosstabs_tables_delete_short'].'"><i class="fa fa-times link-sv-moder"></i></a>',
iconv(mb_detect_encoding( $uporabnik->name, mb_detect_order(), true), "UTF-8", $uporabnik->name) .' '.iconv(mb_detect_encoding( $uporabnik->surname, mb_detect_order(), true), "UTF-8", $uporabnik->surname),
(!empty($uporabnik->second_email) ? iconv(mb_detect_encoding( $uporabnik->second_email, mb_detect_order(), true), "UTF-8", $uporabnik->second_email) : iconv(mb_detect_encoding( $uporabnik->email, mb_detect_order(), true), "UTF-8", $uporabnik->email)),
$this->userTypeToText($uporabnik->type),
@@ -1318,30 +1456,26 @@ class Dostop {
(!empty($uporabnik->st_arhivskih) ? $uporabnik->st_arhivskih : 0),
$lang["users_gdpr".$uporabnik->gdpr_agree],
$uporabnik->registriran,
- $uporabnik->last_login,
- '<a href="#" onclick="edit_user(\''.$uporabnik->id.'\'); return false;" title="'.$lang['srv_info_modify'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a>'.
- ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'ban\'); return false;" title="'.$lang[($uporabnik->status == 0 ? 'srv_user_banned' : 'srv_user_notbanned')].'"><i class="fa fa-ban '.($uporabnik->status == 0 ? 'link-rdec' : 'link-sv-moder').'"></i></a>'.
- ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'delete\'); return false;" title="'.$lang['srv_multicrosstabs_tables_delete_short'].'"><i class="fa fa-times link-sv-moder"></i></a>'
+ $uporabnik->last_login
];
}
}
// Število vseh zadetkov, ki jih imamo v bazi
- $recordsTotal = 0;
- $recordsTotal = sizeof($vsi);
+ $recordsTotal = (is_countable($vsi)) ? sizeof($vsi) : 0;
// Število filtriranih zadetkov
$recordFiltered = $recordsTotal;
if(!empty($_POST['search']['value']))
- $recordFiltered = sizeof($vsi);
+ $recordFiltered = $recordsTotal;
echo json_encode([
- "draw" => (!empty($_POST['draw']) ? $_POST['draw'] : 1),
- "recordsTotal" => $recordsTotal,
- "recordsFiltered" => $recordFiltered,
- "data" => $seznam // polje z vsebino
- ]);
+ "draw" => (!empty($_POST['draw']) ? $_POST['draw'] : 1),
+ "recordsTotal" => $recordsTotal,
+ "recordsFiltered" => $recordFiltered,
+ "data" => $seznam // polje z vsebino
+ ]);
}
/**
@@ -1507,7 +1641,6 @@ class Dostop {
public function ajax_confirm_user_email(){
global $pass_salt;
global $lang;
- global $app_settings;
$uid = (!empty($_POST['uid']) ? $_POST['uid'] : NULL);
@@ -1522,9 +1655,14 @@ class Dostop {
$r = mysqli_fetch_assoc($result);
$g = base64_encode((hash('SHA256', base64_decode($r['pass']) . $pass_salt)));
- sisplet_query("INSERT INTO users (type, email, name, surname, pass, status, gdpr_agree, when_reg, came_from, lang, manuallyApproved)
+ $sqlCopy = sisplet_query("INSERT INTO users (type, email, name, surname, pass, status, gdpr_agree, when_reg, came_from, lang, manuallyApproved)
VALUES ('" . $r['type'] . "', '" . $r['email'] . "', '" . $r['name'] . "', '" . $r['surname'] . "', '" . $g . "','" . $r['status'] . "', '" . $r['gdpr_agree'] . "','" . $r['when_reg'] . "', '" . $r['came_from'] . "', '" . $r['lang'] . "', 'Y')");
- sisplet_query("DELETE FROM users_to_be WHERE id='" . $uid . "' OR email='" . $r['email'] . "'");
+ if (!$sqlCopy) {
+ echo mysqli_error($GLOBALS['connect_db']);
+ return;
+ }
+
+ sisplet_query("DELETE FROM users_to_be WHERE id='" . $uid . "' OR email='" . $r['email'] . "'");
// Uporabniku posljemo email da je bil njegov racun aktiviran
@@ -1537,7 +1675,7 @@ class Dostop {
// Ce gre slucajno za virutalko
$Subject = $lang['confirmed_user_mail_subject'];
- $PageName = $app_settings['app_name'];
+ $PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
$ZaMail = '<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">'.'<html><head> <title>'.$Subject.'</title><meta content="text/html; charset=utf-8" http-equiv=Content-type></head><body>';
// Besedilo v lang dilu je potrebno popravit, ker nimamo vec cel kup parametrov
@@ -1593,13 +1731,13 @@ class Dostop {
$seznam = [];
foreach ($nepotrjeni as $uporabnik) {
$seznam[] = [
+ '<span onclick="potrdiNepotrjenegaUporabnika(' . $uporabnik->id . ')" title="' . $lang['confirm_user_in_db'] . '" class="faicon fa-check pointer blue"></span> | ' .
+ '<span onclick="izbrisiNepotrjenegaUporabnika(' . $uporabnik->id . ')" title="'.$lang['delete_user_in_db'].'" class="faicon fa-times pointer blue"></span>',
iconv(mb_detect_encoding( $uporabnik->name, mb_detect_order(), true), "UTF-8", $uporabnik->name) .' '.iconv(mb_detect_encoding( $uporabnik->surname, mb_detect_order(), true), "UTF-8", $uporabnik->surname),
iconv(mb_detect_encoding( $uporabnik->email, mb_detect_order(), true), "UTF-8", $uporabnik->email),
$this->userTypeToText($uporabnik->type),
$admin_languages[$uporabnik->lang],
$uporabnik->registriran,
- '<a href="#" onclick="potrdiNepotrjenegaUporabnika(' . $uporabnik->id . ')" title="' . $lang['confirm_user_in_db'] . '"><i class="fa fa-check link-sv-moder"></i> <span class="no-print"> | </span>' .
- '<a href="#" onclick="izbrisiNepotrjenegaUporabnika(' . $uporabnik->id . ')" title="'.$lang['delete_user_in_db'].'"><i class="fa fa-times link-sv-moder"></a>',
];
}
}
@@ -1645,7 +1783,7 @@ class Dostop {
echo ' - <span class="red italic">NEAKTIVEN</span>';
echo ' </span>';
- echo ' <span><a onClick="dodeljeni_uporabniki_remove(\''.$manager.'\', \''.$rowUsers['id'].'\');">'.$lang['hour_remove'].'</a></span>';
+ echo ' <span class="faicon delete" onClick="dodeljeni_uporabniki_remove(\''.$manager.'\', \''.$rowUsers['id'].'\');" title="'.$lang['hour_remove'].'"></span>';
echo '</li>';
}
@@ -1654,18 +1792,13 @@ class Dostop {
}
// Dodajanje novega uporabnika
- echo '<h4>'.$lang['srv_manager_add_admin'].'</h4>';
- echo '<div class="add_user">';
- echo '<form class="manager_add_user" name="admin_add_dostop" action="ajax.php?t=dostop&a=admin_add_user" method="post">';
-
- echo '<h3><b>'.$lang['srv_manager_add_user_popup'].'</b></h3>';
- echo '<p><select name="add_user_id" id="add_user_id" class="js-obstojeci-uporabniki-admin-ajax" style="width: 300px;"></select></p>';
+ echo '<div class="seting_holder add_user">';
- echo '<p><div class="buttonwrapper floatLeft">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onClick="dodeljeni_uporabniki_add(\''.$manager.'\', \''.$rowUsers['id'].'\');">'.$lang['add'].'</a>';
- echo '</div></p><br><br>';
-
+ echo '<label for="add_user_id">'.$lang['srv_manager_add_user_popup'].':</label>';
+ echo '<form class="manager_add_user" name="admin_add_dostop" action="ajax.php?t=dostop&a=admin_add_user" method="post">';
+ echo ' <select name="add_user_id" id="add_user_id" class="js-obstojeci-uporabniki-admin-ajax dropdown" style="width: 300px;"></select>';
+ echo ' <button class="medium blue" onClick="dodeljeni_uporabniki_add(\''.$manager.'\', \''.$rowUsers['id'].'\');">'.$lang['add'].'</button>';
echo '</form>';
echo '<script>$(\'.js-obstojeci-uporabniki-admin-ajax\').select2({
@@ -1681,8 +1814,8 @@ class Dostop {
echo '</div>';
- echo '<div class="buttons_holder">';
- echo '<span class="buttonwrapper floatRight" title="'.$lang['srv_zapri'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dodeljeni_uporabniki_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></span>';
+ echo '<div class="button_holder">';
+ echo ' <button class="blue medium" onclick="dodeljeni_uporabniki_close(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
}
@@ -1736,6 +1869,7 @@ class Dostop {
*/
function getManagersDostop()
{
+ $dostop = array();
$sql = sisplet_query("SELECT u.* FROM users u, srv_dostop_manage m WHERE u.id=m.manager AND m.user IN (SELECT uid FROM srv_dostop WHERE ank_id='$this->anketa') ");
while ($row = mysqli_fetch_array($sql)) {