$subf = $_GET['path'];
$path = $basedir . $subf;
} else {
+ $subf = '/';
$path = $basedir;
}
$squashweb->set_root($basedir);
-if ((isset($_GET['f']) && $_GET['f']!=NULL) || (isset($_GET['d']) && $_GET['d']!=NULL) || $_GET['show_all']==true || $_GET['tools']=='hide' || $_GET['tools']=='unhide' || $_GET['tools']=='delete') {
+if (@$_GET['f'] || @$_GET['d'] || @$_GET['show_all']==true || @$_GET['tools']=='hide' || @$_GET['tools']=='unhide' || @$_GET['tools']=='delete') {
$getdeepfiles=true;
$populate=false;
} else {
$populate=true;
}
-//update folder rights if form is submitted
-if ($submitted['edited_user'] > 0 && $submitted['formtype'] == 'folderrights')
- $squashweb->update_rights($submitted,$_SESSION['creds']['user_level']);
+//update folder rights if form is posted
+if (@$_POST['edited_user'] > 0 && @$_POST['formtype'] == 'folderrights')
+ $squashweb->update_rights($_POST['edited_user'], $_POST['m'], $_SESSION['creds']['user_level']);
//set folder rights
-if (isset($_GET['f']) && $_GET['f']!=NULL) {
+if (@$_GET['f']) {
$squashweb->give_rights(2);
} else {
$squashweb->give_rights($_SESSION['creds']['user_id']);
}
-if (isset($_GET['f']) && $_GET['f']!=NULL) {
+if (@$_GET['f']) {
$f_q = "SELECT * FROM file_hash WHERE md5_hash = '".$_GET['f']."'";
$f_r = mysql_query($f_q);
$f_o = mysql_fetch_object($f_r);
}
//check if a file is requested
-if (isset($_GET['f']) && $_GET['f']!=NULL) {
+if (@$_GET['f']) {
//get the config of requested file
$request = $squashweb->get_config($_GET['f']);
//-check-file-and-request-type-end-
//---------------------------------
-} elseif ($tools=="hide" && isset($_GET['h'])) {
+} elseif (@$_GET['tools']=="hide" && @$_GET['h']) {
if ($_SESSION['creds']['user_level'] > 99) {
$request = $squashweb->get_config($_GET['h']);
$handle = fopen($request['path'].'/'.$request[2].'.hidden', 'x');
$path=substr($request['path'], strlen($basedir));
header( 'Location: '.$_SERVER['PHP_SELF'].'?path='.$path) ;
}
-} elseif ($tools=="unhide" && isset($_GET['h'])) {
+} elseif (@$_GET['tools']=="unhide" && isset($_GET['h'])) {
if ($_SESSION['creds']['user_level'] > 99) {
$request = $squashweb->get_config($_GET['h']);
@unlink($request['path'].'/'.$request[2].'.hidden');
$path=substr($request['path'], strlen($basedir));
header( 'Location: '.$_SERVER['PHP_SELF'].'?path='.$path) ;
}
-} elseif ($tools=="delete" && isset($_GET['h'])) {
+} elseif (@$_GET['tools']=="delete" && isset($_GET['h'])) {
if ($_SESSION['creds']['user_level'] > 99) {
if ($_GET['h'] == "multiple") {
$h_post = $_POST['h'];
$smarty->assign('user_name', $_SESSION['creds']['user_name']);
$smarty->assign('users', $squashweb->get_users($_SESSION['creds']['user_level']));
- $smarty->assign('edited_user', $_GET['user']);
+ $smarty->assign('edited_user', @$_GET['user']);
- $tree = $squashweb->show_rights_tree($path, 0, $_GET['user']);
+ $tree = $squashweb->show_rights_tree($path, 0, @$_GET['user']);
$smarty->assign('style', $tree['style']);
$smarty->assign('layout', $tree['layout']);
- $smarty->assign('debug', $vars['debug']);
+ $smarty->assign('debug', @$_GET['debug']);
$smarty->assign('folderrights', $squashweb->folderrights());
$smarty->assign('userrights', $squashweb->userrights());
$smarty->display('admin.tpl');
} elseif (@$_GET['tools']=='users' && $_SESSION['creds']['user_level'] > 100) {
-
- if ($submitted['type']=="update")
- $squashweb->update_users($submitted);
- if ($submitted['type']=="disable")
- $squashweb->disable_users($submitted);
- if ($submitted['type']=="delete")
- $squashweb->remove_users($submitted);
- if ($submitted['type']=="new")
- $squashweb->insert_users($submitted, $_SESSION['creds']['user_level']);
+ $type = @$_POST['type'];
+ if ($type=="update")
+ $squashweb->update_users($_POST['u']);
+ if ($type=="disable")
+ $squashweb->disable_users($_POST['u']);
+ if ($type=="delete")
+ $squashweb->remove_users($_POST['u']);
+ if ($type=="new")
+ $squashweb->insert_users($_POST['u'], $_SESSION['creds']['user_level']);
require_once("smarty/Smarty.class.php");
$smarty = new Smarty;
} else {
$smarty->assign('user_levels', array(55 => 'user' ) );
}
- $smarty->assign('debug',$vars['debug']);
+ $smarty->assign('debug', @$_GET['debug']);
$smarty->display('udmin.tpl');
-} elseif ($_GET['tools']=='logs' && $_SESSION['creds']['user_level'] > 100) {
- $logtype=($_GET['logtype']) ? $_GET['logtype'] : 'all';
+} elseif (@$_GET['tools']=='logs' && $_SESSION['creds']['user_level'] > 100) {
+ $logtype=@$_GET['logtype'];
+ if (!$logtype)
+ $logtype = 'all';
require_once("smarty/Smarty.class.php");
$smarty = new Smarty;
$smarty->assign('logtype', $logtype);
$smarty->assign('logs', $squashweb->get_logs($logtype));
+ $smarty->assign('debug', @$_GET['debug']);
$smarty->display('logs.tpl');
} else {
$configs_sorted = named_records_sort($configs_num, 'lastchange', true);
+ $configs = array();
+ $paths = array();
+
foreach ($configs_sorted as $key => $value) {
$configs[$key]['squashed'] = $value['squashed'];
$configs[$key]['version'] = $value[0];
//set base folders
$basepath['/'] = ' top ';
- foreach (explode('/',$subf) as $key => $value) {
+ $bpath = '';
+ foreach (explode('/', $subf) as $key => $value) {
if ($value != '') {
$bpath .= '/'.$value;
$basepath[$bpath] = $value;
}
}
- $smarty->assign('debug', $vars['debug']);
+ $smarty->assign('debug', @$_GET['debug']);
$smarty->assign('user_level', $_SESSION['creds']['user_level']);
$smarty->assign('user_name', $_SESSION['creds']['user_name']);
$smarty->assign('folderrights', $squashweb->folderrights());
$smarty->assign('base', $basepath);
$smarty->assign('currentfolder', $subf);
$subs = $squashweb->subfolders();
- asort($subs);
+ if ($subs)
+ asort($subs);
$smarty->assign('subfolders', $subs);
- //if($vars[debug])print_r($configs);
- if (!$vars['newtpl'])
+ //if(@$_GET[debug]) print_r($configs);
+ if (!@$_GET['newtpl'])
$smarty->display('index.tpl'); //Display normal template
- if ($vars['newtpl'])
+ else
$smarty->display('wip_massdelete.tpl'); //Display Work In Progress template
}