@@ -19,28 +19,28 @@ |
||
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | if ( |
| 22 | - isset($_SESSION['CPM']) === false || $_SESSION['CPM'] !== 1 |
|
| 22 | + isset($_SESSION['CPM']) === false || $_SESSION['CPM'] !== 1 |
|
| 23 | 23 | || isset($_SESSION['user_id']) === false || empty($_SESSION['user_id']) === true |
| 24 | 24 | || isset($_SESSION['key']) === false || empty($_SESSION['key']) === true |
| 25 | 25 | ) { |
| 26 | - die('Hacking attempt...'); |
|
| 26 | + die('Hacking attempt...'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | // Load config |
| 30 | 30 | if (file_exists('../includes/config/tp.config.php') === true) { |
| 31 | - include_once '../includes/config/tp.config.php'; |
|
| 31 | + include_once '../includes/config/tp.config.php'; |
|
| 32 | 32 | } elseif (file_exists('./includes/config/tp.config.php') === true) { |
| 33 | - include_once './includes/config/tp.config.php'; |
|
| 33 | + include_once './includes/config/tp.config.php'; |
|
| 34 | 34 | } else { |
| 35 | - throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
|
| 35 | + throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /* do checks */ |
| 39 | 39 | require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
| 40 | 40 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], "special", $SETTINGS) === false) { |
| 41 | - $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
|
| 42 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 43 | - exit(); |
|
| 41 | + $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
|
| 42 | + include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 43 | + exit(); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Load template |
@@ -19,28 +19,28 @@ |
||
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | if ( |
| 22 | - isset($_SESSION['CPM']) === false || $_SESSION['CPM'] !== 1 |
|
| 22 | + isset($_SESSION['CPM']) === false || $_SESSION['CPM'] !== 1 |
|
| 23 | 23 | || isset($_SESSION['user_id']) === false || empty($_SESSION['user_id']) === true |
| 24 | 24 | || isset($_SESSION['key']) === false || empty($_SESSION['key']) === true |
| 25 | 25 | ) { |
| 26 | - die('Hacking attempt...'); |
|
| 26 | + die('Hacking attempt...'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | // Load config |
| 30 | 30 | if (file_exists('../includes/config/tp.config.php') === true) { |
| 31 | - include_once '../includes/config/tp.config.php'; |
|
| 31 | + include_once '../includes/config/tp.config.php'; |
|
| 32 | 32 | } elseif (file_exists('./includes/config/tp.config.php') === true) { |
| 33 | - include_once './includes/config/tp.config.php'; |
|
| 33 | + include_once './includes/config/tp.config.php'; |
|
| 34 | 34 | } else { |
| 35 | - throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
|
| 35 | + throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /* do checks */ |
| 39 | 39 | require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
| 40 | 40 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'utilities', $SETTINGS) === false) { |
| 41 | - $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
|
| 42 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 43 | - exit(); |
|
| 41 | + $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
|
| 42 | + include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 43 | + exit(); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Load template |
@@ -68,8 +68,8 @@ |
||
| 68 | 68 | |
| 69 | 69 | // Quick major version check -> upgrade needed? |
| 70 | 70 | if (isset($SETTINGS['cpassman_version']) === true && version_compare(TP_VERSION, $SETTINGS['cpassman_version']) > 0) { |
| 71 | - // Perform redirection |
|
| 72 | - if (headers_sent()) { |
|
| 71 | + // Perform redirection |
|
| 72 | + if (headers_sent()) { |
|
| 73 | 73 | echo '<script language="javascript" type="text/javascript">document.location.replace("install/install.php");</script>'; |
| 74 | 74 | } else { |
| 75 | 75 | header('Location: install/upgrade.php'); |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | ); |
| 952 | 952 | |
| 953 | 953 | // Does the user has the sharekey |
| 954 | - //db::debugmode(true); |
|
| 954 | + //db::debugmode(true); |
|
| 955 | 955 | DB::query( |
| 956 | 956 | 'SELECT * |
| 957 | 957 | FROM ' . prefixTable('sharekeys_items') . ' |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | $postArrayTags = explode(' ', $post_tags); |
| 1091 | 1091 | foreach ($postArrayTags as $tag) { |
| 1092 | 1092 | if (empty($tag) === false) { |
| 1093 | - // save in DB |
|
| 1093 | + // save in DB |
|
| 1094 | 1094 | DB::insert( |
| 1095 | 1095 | prefixTable('tags'), |
| 1096 | 1096 | array( |
@@ -2601,7 +2601,7 @@ discard block |
||
| 2601 | 2601 | foreach ($rows_tmp as $row) { |
| 2602 | 2602 | // Uncrypt data |
| 2603 | 2603 | // Get the object key for the user |
| 2604 | - //db::debugmode(true); |
|
| 2604 | + //db::debugmode(true); |
|
| 2605 | 2605 | $userKey = DB::queryFirstRow( |
| 2606 | 2606 | 'SELECT share_key |
| 2607 | 2607 | FROM ' . prefixTable('sharekeys_fields') . ' |
@@ -4295,20 +4295,20 @@ discard block |
||
| 4295 | 4295 | } |
| 4296 | 4296 | } |
| 4297 | 4297 | |
| 4298 | - // Get access level for this folder |
|
| 4299 | - $accessLevel = 20; |
|
| 4300 | - if ($folder_is_personal === 0) { |
|
| 4301 | - $arrTmp = []; |
|
| 4302 | - foreach ($_SESSION['user_roles'] as $role) { |
|
| 4303 | - //db::debugmode(true); |
|
| 4304 | - $access = DB::queryFirstRow( |
|
| 4305 | - 'SELECT type |
|
| 4298 | + // Get access level for this folder |
|
| 4299 | + $accessLevel = 20; |
|
| 4300 | + if ($folder_is_personal === 0) { |
|
| 4301 | + $arrTmp = []; |
|
| 4302 | + foreach ($_SESSION['user_roles'] as $role) { |
|
| 4303 | + //db::debugmode(true); |
|
| 4304 | + $access = DB::queryFirstRow( |
|
| 4305 | + 'SELECT type |
|
| 4306 | 4306 | FROM ' . prefixTable('roles_values') . ' |
| 4307 | 4307 | WHERE role_id = %i AND folder_id = %i', |
| 4308 | - $role, |
|
| 4309 | - $post_groupe |
|
| 4310 | - ); |
|
| 4311 | - //db::debugmode(false); |
|
| 4308 | + $role, |
|
| 4309 | + $post_groupe |
|
| 4310 | + ); |
|
| 4311 | + //db::debugmode(false); |
|
| 4312 | 4312 | if (DB::count()>0) { |
| 4313 | 4313 | if ($access['type'] === 'R') { |
| 4314 | 4314 | array_push($arrTmp, 10); |
@@ -4329,12 +4329,12 @@ discard block |
||
| 4329 | 4329 | } |
| 4330 | 4330 | } |
| 4331 | 4331 | } |
| 4332 | - } |
|
| 4333 | - // 3.0.0.0 - changed MIN to MAX |
|
| 4334 | - $accessLevel = count($arrTmp) > 0 ? max($arrTmp) : $accessLevel; |
|
| 4335 | - } elseif ($folder_is_personal === 1) { |
|
| 4336 | - $accessLevel = 30; |
|
| 4337 | - } |
|
| 4332 | + } |
|
| 4333 | + // 3.0.0.0 - changed MIN to MAX |
|
| 4334 | + $accessLevel = count($arrTmp) > 0 ? max($arrTmp) : $accessLevel; |
|
| 4335 | + } elseif ($folder_is_personal === 1) { |
|
| 4336 | + $accessLevel = 30; |
|
| 4337 | + } |
|
| 4338 | 4338 | |
| 4339 | 4339 | $returnValues = array( |
| 4340 | 4340 | 'folderId' => (int) $post_groupe, |