function can_delete() { if (perm_chck($this->del)) { return TRUE; } else { return FALSE; } }
/** * that function you don't have to use it at all * it's the PHP backend to the directory chooser widget of gui class * it returns ist of directories within the passed directory via POST * */ function dir() { if (!perm_chck('edit')) { show_error("permission denied"); } $root = ''; $_POST['dir'] = urldecode($_POST['dir']); if (file_exists($root . $_POST['dir'])) { $files = scandir($root . $_POST['dir']); natcasesort($files); if (count($files) > 2) { /* The 2 accounts for . and .. */ echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">"; // All dirs foreach ($files as $file) { if (file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($root . $_POST['dir'] . $file)) { echo "<li class=\"file ext_file\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">Choose " . htmlentities($file) . "</a></li>"; echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>"; } } echo "</ul>"; } } }
function can_view() { if (!(empty($this->view) or perm_chck($this->view))) { return FALSE; } else { return TRUE; } }
function can_view() { return perm_chck($this->perm); }
/** * true if the user can view that content * false if the user not permitted to see it * * @return boolean if that content could be viewed or not , * depending on the current system conditions **/ public function can_view() { return empty($this->view) or perm_chck($this->view); }