本文整理汇总了PHP中perm函数的典型用法代码示例。如果您正苦于以下问题:PHP perm函数的具体用法?PHP perm怎么用?PHP perm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了perm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ensure
/**
* Ensure that user has a specified permission
*
* @param $permission
* @return \Illuminate\Http\RedirectResponse|null
*/
public function ensure($permission)
{
$perm = perm();
if ($perm == 'admin' || perm() == $permission) {
return null;
}
return redirect()->back();
}
示例2: clearLog
public function clearLog()
{
perm('dash', 'Activity', $this->Session->read("user_perm"), true);
if ($this->request->is('ajax')) {
$server = $this->Session->read("current_server");
$logfile = TMP . "server/" . $server . ".log";
$file = new File($logfile);
if ($file->exists()) {
$log = $file->delete();
return $log;
}
}
}
示例3: perm
function perm($arr, $n, $result = array())
{
if ($n <= 0) {
return false;
}
$i = 0;
$new_result = array();
foreach ($arr as $r) {
if (count($result) > 0) {
foreach ($result as $res) {
$new_element = array_merge($res, array($r));
$new_result[] = $new_element;
}
} else {
$new_result[] = array($r);
}
}
if ($n == 1) {
return $new_result;
}
return perm($arr, $n - 1, $new_result);
}
示例4: dirname
<?php
require_once dirname(__FILE__) . "/permutation.php";
// Writes to: regression_tests/if/correct/if_with_comments.in
$ws = alt("", " \t", "\n");
$comment = alt("/*c*/", "//c\n");
$wsComment = alt(clone $ws, clone $comment, clone $ws);
$comments = alt(clone $ws, clone $comment);
$list = perm('{', clone $comments, 'if', clone $comments, '$a', clone $comments, '}', "\n {\$a}\n{/if}");
$a = app("if/correct/if_with_comments.in", $argv);
$a->output("{var \$a = \"foo\"}\n");
do {
$str = $list->generate();
$a->output($str . "\n");
} while ($list->increase());
示例5: auth
analysepca: Boolean analyse shape of images
sanalysisfile: String name of shape analysis file
usepci: Boolean load PCI model from pcifile
pci: Boolean do any color PCI functions
pcifile: String name of PCI model to load or save
analysepci: Boolean analyse colour of images
canalysisfile: String name of colour analysis file
images: String[] list of image paths
texture: Boolean use texture to create average
mask: String name of mask to use for PCI
***********************************************************/
require_once $_SERVER['DOCUMENT_ROOT'] . '/include/main_func.php';
auth();
ini_set('max_execution_time', 6000);
$return = array('error' => true, 'errorText' => '', 'newFileName' => '');
if (!perm('pca')) {
$return['errorText'] .= 'You do not have permission to create a PCA';
} else {
$url = 'http://' . $_SERVER["SERVER_NAME"] . '/tomcat/psychomorph/pca?';
// set up data
$theData = $_POST['theData'];
$theData['subfolder'] = intval($_SESSION['user_id']);
$paramsJoined = array();
foreach ($theData as $param => $value) {
if (is_array($value)) {
foreach ($value as $subvalue) {
$paramsJoined[] = "{$param}={$subvalue}";
}
} else {
$paramsJoined[] = "{$param}={$value}";
}
示例6: storeSettings
/**
* Store saved settings
*
* @param Request $request
* @param UserService $userService
* @return \Illuminate\Http\RedirectResponse
*/
public function storeSettings(Request $request, UserService $userService)
{
$this->validate($request, $this->validationRulesForSettings($request));
$fields = $request->only(['name', 'email', 'password', 'avatar', 'language']);
if (perm('demo')) {
unset($fields['password']);
unset($fields['language']);
}
$userService->updateProfile($this->currentUser, $fields);
return redirect()->back();
}
示例7: dirname
<?php
require_once dirname(__FILE__) . "/permutation.php";
// Writes to: regression_tests/blocks/incorrect/block_invalid_closing_*.in
$singleBlockNames = alt("var", "cycle", "use", "increment", "decrement", "reset", "return", "break", "skip", "continue", "else", "elseif", "include", "ldelim", "rdelim");
$nestedBlockNames = alt("foreach", "while", "if", "switch", "case", "default", "delimiter", "literal");
$otherNames = alt("tru", "fals", "ray");
$alts = alt($singleBlockNames, $nestedBlockNames, $otherNames);
$data = alt("", " \$foo");
$lineStart = perm("{/", $alts);
$line = perm($lineStart, $data, "}");
$list = perm($line, "\n");
$a = app("", $argv);
$dir = $a->dir;
$i = 1;
do {
$num = sprintf("%04d", $i);
$str = $list->generate();
$fileIn = $dir . "/blocks/incorrect/block_invalid_closing_" . $num . ".in";
$fileOut = $dir . "/blocks/incorrect/block_invalid_closing_" . $num . ".out";
$name = $alts->generate();
$a->store("{* file: " . "block_invalid_closing_" . $num . ".in" . " *}\n{var \$foo = \"T42p\"}\n" . $str . "\n", $fileIn);
if ($alts->index == 0) {
$dataText = $data->generate();
$a->store("mock:3:2: This block cannot be closed.\n" . "\n" . "{/{$name}{$dataText}}\n" . " ^\n", $fileOut);
} elseif ($alts->index == 1) {
$lineText = $line->generate();
if ($data->index == 0) {
$offset = strlen($line->generate()) + 1;
$a->store("mock:3:{$offset}: Found closing block {/{$name}} without an opening block.\n" . "\n" . "{$lineText}\n" . str_repeat(" ", $offset - 1) . "^\n", $fileOut);
} else {
示例8: details
//.........这里部分代码省略.........
$i = 0;
$key = 0;
while ($stkd = pg_fetch_array($stkdRslt)) {
# Keep track of selected stock amounts
$amts[$i] = $stkd['amt'];
$i++;
# Get warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$stkd['whid']}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# Get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkd['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
# Serial number
if ($stk['serd'] == 'yes' && $inv['serd'] == 'n') {
$sers = ext_getavserials($stkd['stkid']);
$sernos = "<select class='width : 15' name='sernos[]'>";
foreach ($sers as $skey => $ser) {
$sernos .= "<option value='{$ser['serno']}'>{$ser['serno']}</option>";
}
$sernos .= "</select>";
} else {
$sernos = "<input type=hidden name=sernos[] value='{$stkd['serno']}'>{$stkd['serno']}";
}
# Input qty if not serialised
$qtyin = "<input type=text size=3 name=qtys[] value='{$stkd['qty']}'>";
if ($stk['serd'] == 'yes') {
$qtyin = "<input type=hidden size=3 name=qtys[] value='{$stkd['qty']}'>{$stkd['qty']}";
}
# check permissions
if (perm("invoice-unitcost-edit.php")) {
$viewcost = "<input type=text size=8 name=unitcost[] value='{$stkd['unitcost']}'>";
} else {
$viewcost = "<input type=hidden size=8 name=unitcost[] value='{$stkd['unitcost']}'>{$stkd['unitcost']}";
}
# Put in product
$products .= "<tr class='bg-odd'><td><input type=hidden name=whids[] value='{$stkd['whid']}'>{$wh['whname']}</td><td><input type=hidden name=stkids[] value='{$stkd['stkid']}'><a href='#bottom' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td><td>{$sernos}</td><td>" . extlib_rstr($stk['stkdes'], 30) . "</td><td>{$qtyin}</td><td>{$viewcost}</td><td><input type=text size=4 name=disc[] value='{$stkd['disc']}'> OR <input type=text size=4 name=discp[] value='{$stkd['discp']}' maxlength=5>%</td><td><input type=hidden name=amt[] value='{$stkd['amt']}'> " . CUR . " {$stkd['amt']}</td><td><input type=checkbox name=remprod[] value='{$key}'><input type=hidden name=SCROLL value=yes></td></tr>";
$key++;
}
# Look above(remprod keys)
$keyy = $key;
# Look above(if i = 0 then there are no products)
if ($i == 0) {
$done = "";
} else {
$SCROLL = "yes";
}
# check if stock warehouse was selected
if (isset($whidss)) {
foreach ($whidss as $key => $whid) {
if (isset($stkidss[$key]) && $stkidss[$key] != "-S" && isset($cust['pricelist'])) {
# skip if not selected
if ($whid == "-S") {
continue;
}
# Get selected warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$whid}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# Get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkidss[$key]}' AND div = '" . USER_DIV . "' ORDER BY stkcod ASC";
示例9: dirname
<?php
require_once dirname(__FILE__) . "/permutation.php";
// Writes to: regression_tests/array_fetch/correct/comments.in
$ws = alt("", " \t", "\n");
$comment = alt("/*c*/", "//c\n");
$wsComment = alt(clone $ws, clone $comment, clone $ws);
$comments = alt(clone $ws, clone $comment);
$list = perm("{\$a[", clone $comments, '0', clone $comments, "]}\n");
$a = app("array_fetch/correct/comments.in", $argv);
$a->output("{var \$a = array( 0 => 'foo' )}\n");
$i = 0;
do {
$str = $list->generate();
$a->output($str);
++$i;
} while ($list->increase());
$a->close();
$a->store(str_repeat("foo\n", $i), $a->dir . "/array_fetch/correct/comments.out");
示例10: while
print "<table border=0 width=100%><td width=5% id=s><b>Options</b></td><td id=s><b>Filename</b></td><td id=s><b>Size</b></td><td id=s><b>Permissions</b></td><tr>";
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if (is_dir($file)) {
$directories[] = $file;
} else {
$files[] = $file;
}
}
asort($directories);
asort($files);
foreach ($directories as $file) {
print "<td id=d><a href=\"?p=rename&file=" . realpath($file) . "&dir=" . realpath('.') . "\">[R]</a><a href=\"?p=delete&file=" . realpath($file) . "\">[D]</a></td><td id=d><a href=\"" . $me . "?dir=" . realpath($file) . "\">" . $file . "</a></td><td id=d ></td><td id=d><a href=\"?p=chmod&dir=" . realpath('.') . "&file=" . realpath($file) . "\">" . perm($file) . "</a></td><tr>";
}
foreach ($files as $file) {
print "<td id=f><a href=\"?p=rename&file=" . realpath($file) . "&dir=" . realpath('.') . "\">[R]</a><a href=\"?p=delete&file=" . realpath($file) . "\">[D]</a></td><td id=f><a href=\"" . $me . "?p=edit&dir=" . realpath('.') . "&file=" . realpath($file) . "\">" . $file . "</a></td><td id=f>" . filesize($file) . "</td><td id=f><a href=\"?p=chmod&dir=" . realpath('.') . "&file=" . realpath($file) . "\">" . perm($file) . "</a></td><tr>";
}
} else {
print "<u>Error!</u> Can't open <b>" . realpath('.') . "</b>!<br>";
}
print "</table><hr><table border=0 width=100%><td>Upload file<br><form enctype=\"multipart/form-data\" action=\"" . $me . "?dir=" . realpath('.') . "\" method=\"POST\">\n\n<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"100000000\" /><input name=\"uploadedfile\" type=\"file\" />\n\n<input type=\"submit\" value=\"Upload File\" />\n\n</form></td><td><form action=\"" . $me . "\" method=GET><b>Directory:</b><input type=text size=40 name=dir value=\"" . realpath('.') . "\"><input type=submit value=\"Change Directory\"></form></td></table>";
}
function login()
{
print "<table border=0 width=100% height=100%><td valign=\"middle\"><center>\n\n\t<form action=" . basename(__FILE__) . " method=\"POST\"><b>Password?</b>\n\n\t<input type=\"password\" maxlength=\"32\" name=\"pass\"><input type=\"submit\" value=\"Login\">\n\n\t</form>";
}
function reload()
{
header("Location: " . basename(__FILE__));
}
function get_execution_method()
示例11: posix_getgrgid
$owner=$fileownera['name'];
}
$group = @filegroup($d."/".$files[$i]);
if($os=="unix"){
$groupinfo = posix_getgrgid($group);
$group=$groupinfo['name'];
}
$info=perm($perms);
if($i%2){$color="#D1D1D1";}else{$color="#D7FFA8";}
if ($size < 1024){$siz=$size.' b';
}else{
if ($size < 1024*1024){$siz=number_format(($size/1024), 2, '.', '').' kb';}else{
if ($size < 1000000000){$siz=number_format($size/(1024*1024), 2, '.', '').' mb';}else{
if ($size < 1000000000000){$siz=number_format($size/(1024*1024*1024), 2, '.', '').' gb';}
示例12: details
//.........这里部分代码省略.........
$key++;
++$ai;
} else {
# Keep track of selected stock amounts
$amts[$i] = $stkd['amt'];
$i++;
# Get warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$stkd['whid']}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# Get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkd['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
# Serial number
if ($stk['serd'] == 'yes' && ($inv['serd'] == 'n' || $stkd["serno"] == "")) {
$sers = ext_getavserials($stkd['stkid']);
$sernos = "<select name='sernos[{$ai}]'>";
foreach ($sers as $skey => $ser) {
$sernos .= "<option value='{$ser['serno']}'>{$ser['serno']}</option>";
}
$sernos .= "</select>\n\t\t\t\t\t<input type='hidden' name='sernos_ss[]' value='*_*_*CUBIT_SERIAL_SELECT_BOX*_*_*' />";
} else {
$sernos = "\n\t\t\t\t\t<input type='hidden' name='sernos_ss[]' value='{$stkd['ss']}' />\n\t\t\t\t\t<input type='hidden' name='sernos[{$ai}]' value='{$stkd['serno']}'>{$stkd['ss']}";
}
# Input qty if not serialised
$qtyin = "<input type='text' size='3' name='qtys[{$ai}]' value='{$stkd['qty']}'>";
if ($stk['serd'] == 'yes') {
$qtyin = "<input type='hidden' size='3' name='qtys[{$ai}]' value='{$stkd['qty']}'>{$stkd['qty']}";
}
# check permissions
if (perm("invoice-unitcost-edit.php")) {
$viewcost = "<input type='text' size='8' name='unitcost[{$ai}]' value='{$stkd['unitcost']}'>";
} else {
$viewcost = "<input type='hidden' size='8' name='unitcost[{$ai}]' value='{$stkd['unitcost']}'>{$stkd['unitcost']}";
}
db_conn('cubit');
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "\n\t\t\t\t<select name='vatcodes[{$ai}]'>\n\t\t\t\t\t<option value='0'>Select</option>";
while ($vd = pg_fetch_array($Ri)) {
if ($stkd['vatcode'] == $vd['id']) {
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
# Put in product
$products .= "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type='hidden' name='accounts[{$ai}]' value='0'>\n\t\t\t\t\t\t<input type='hidden' name='descriptions[{$ai}]' value=''>\n\t\t\t\t\t\t<input type='hidden' name='whids[{$ai}]' value='{$stkd['whid']}'>{$wh['whname']}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td><input type='hidden' name='stkids[]' value='{$stkd['stkid']}'><a href='#bottom' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td>\n\t\t\t\t\t<td>{$Vatcodes}</td>\n\t\t\t\t\t<td>{$sernos}</td>\n\t\t\t\t\t<td>" . extlib_rstr($stk['stkdes'], 30) . "</td>\n\t\t\t\t\t<td>{$qtyin}</td>\n\t\t\t\t\t<td>{$viewcost}</td>\n\t\t\t\t\t<td><input type='text' size='4' name='disc[{$ai}]' value='{$stkd['disc']}'> OR <input type='text' size='4' name='discp[{$ai}]' value='{$stkd['discp']}' maxlength='5'>%</td>\n\t\t\t\t\t<td nowrap><input type='hidden' name='amt[{$ai}]' value='{$stkd['amt']}'> " . CUR . " {$stkd['amt']}</td>\n\t\t\t\t\t<td><input type='checkbox' name='remprod[{$ai}]' value='{$key}'></td>\n\t\t\t\t</tr>";
$key++;
++$ai;
}
}
# Look above(remprod keys)
$keyy = $key;
# Look above(if i = 0 then there are no products)
if ($i == 0) {
$done = "";
} else {
$SCROLL = "yes";
}
# check if stock warehouse was selected
示例13: mapautotrim
function mapautotrim()
{
perm('worlds', 'runMapAutoTrim', $this->Session->read("user_perm"), true);
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
require APP . 'spacebukkitcall.php';
//notify users
$args = array($this->Session->read("Sbvars.10"), '$bServer will shut down shortly due to map mainteniance with MapAutoTrim');
$api->call("broadcastWithName", $args, false);
sleep(10);
//run MapAutoTrim
$vars = $this->request->data;
$args2 = array($vars['world'], $vars['dilatation'], $vars['blocks']);
$api->call("runMapTrimmer", $args2, true);
sleep(5);
w_serverlog($this->Session->read("current_server"), __('[WORLDS] ') . $this->Auth->user('username') . ' ' . __('ran MapAutoTrim on') . ' ' . $vars['world']);
while (is_null($api->call('getWorlds', array(), false))) {
sleep(1);
}
$this->redirect($this->referer());
}
示例14: while
print "<table border=0 width=100%><td width=5% id=s><b>Options</b></td><td id=s><b>Filename</b></td><td id=s><b>Size</b></td><td id=s><b>Permissions</b></td><td id=s>Last modified</td><tr>";
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if (is_dir($file)) {
$directories[] = $file;
} else {
$files[] = $file;
}
}
asort($directories);
asort($files);
foreach ($directories as $file) {
print "<td id=d><a href=\"?p=rename&file=" . realpath($file) . "&dir=" . realpath('.') . "\">[R]</a><a href=\"?p=delete&file=" . realpath($file) . "\">[D]</a></td><td id=d><a href=\"" . $me . "?dir=" . realpath($file) . "\">" . $file . "</a></td><td id=d></td><td id=d><a href=\"?p=chmod&dir=" . realpath('.') . "&file=" . realpath($file) . "\"><font color=" . get_color($file) . ">" . perm($file) . "</font></a></td><td id=d>" . date("Y/m/d, H:i:s", filemtime($file)) . "</td><tr>";
}
foreach ($files as $file) {
print "<td id=f><a href=\"?p=rename&file=" . realpath($file) . "&dir=" . realpath('.') . "\">[R]</a><a href=\"?p=delete&file=" . realpath($file) . "\">[D]</a></td><td id=f><a href=\"" . $me . "?p=edit&dir=" . realpath('.') . "&file=" . realpath($file) . "\">" . $file . "</a></td><td id=f>" . filesize($file) . "</td><td id=f><a href=\"?p=chmod&dir=" . realpath('.') . "&file=" . realpath($file) . "\"><font color=" . get_color($file) . ">" . perm($file) . "</font></a></td><td id=f>" . date("Y/m/d, H:i:s", filemtime($file)) . "</td><tr>";
}
} else {
print "<u>Error!</u> Can't open <b>" . realpath('.') . "</b>!<br>";
}
print "</table><hr><table border=0 width=100%><td><b>Upload file</b><br><form enctype=\"multipart/form-data\" action=\"" . $me . "?dir=" . realpath('.') . "\" method=\"POST\"> \n<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"100000000\" /><input size=30 name=\"uploadedfile\" type=\"file\" /> \n<input type=\"submit\" value=\"Upload File\" /> \n</form></td><td><form action=\"" . $me . "\" method=GET><b>Change Directory<br></b><input type=text size=40 name=dir value=\"" . realpath('.') . "\"><input type=submit value=\"Change Directory\"></form></td> \n<tr><td><form action=\"" . $me . "\" method=GET><b>Create file<br></b><input type=hidden name=dir value=\"" . realpath('.') . "\"><input type=text size=40 name=file value=\"" . realpath('.') . "\"><input type=hidden name=p value=edit><input type=submit value=\"Create file\"></form> \n</td><td><form action=\"" . $me . "\" method=GET><b>Create directory<br></b><input type=text size=40 name=crdir value=\"" . realpath('.') . "\"><input type=hidden name=dir value=\"" . realpath('.') . "\"><input type=hidden name=p value=createdir><input type=submit value=\"Create directory\"></form></td> \n</table>";
}
function login()
{
print "<table border=0 width=100% height=100%><td valign=\"middle\"><center> \n <form action=" . basename(__FILE__) . " method=\"POST\"><b>Password?</b> \n <input type=\"password\" maxlength=\"32\" name=\"pass\"><input type=\"submit\" value=\"Login\"> \n </form>";
}
function reload()
{
header("Location: " . basename(__FILE__));
}
function get_execution_method()
示例15: while
if ($handle = @opendir($dir)) {
while (false != ($link = readdir($handle))) {
$on3 = @posix_getpwuid(@fileowner($dir . "/" . $link));
$gr = @posix_getgrgid(@filegroup($dir . "/" . $link));
if (@is_dir($dir . DIRECTORY_SEPARATOR . $link)) {
$file = array();
@($file['link'] = "<a href='{$me}?dir={$dir}" . DIRECTORY_SEPARATOR . "{$link}'>[ {$link} ]</font></a>");
$file['pir'] = "<a href='?sws=chmod&file={$link}&dir={$dir}'\">" . @wsoPermsColor($dir . "/" . $link) . "</a>";
$file['pir2'] = "<a href='?sws=chmod&file={$link}&dir={$dir}'\">" . @perm($dir . "/" . $link) . "</a>";
$folder = "<tr><td> " . $file['link'] . "</td><td>dir</td><td>" . date('Y-m-d H:i:s', @filemtime($dir . "/" . $link)) . "</td><td>" . $on3['name'] . "/" . $gr['name'] . "</td><td>" . $file['pir'] . " " . $file['pir2'] . "<td><a href='?sws=rname&file={$link}&dir={$dir}'\">R</a> - <a href='?sws=chmod&file={$link}&dir={$dir}'\">C</a> - <a href='?sws=rm&file={$link}&dir={$dir}'\">rm</a></td></td></tr></div>";
array_push($folders, $folder);
} else {
$file = array();
$ext = @strpos($link, ".") ? @strtolower(end(explode(".", $link))) : "";
$file['pir'] = "<a href='?sws=chmod&file={$link}&dir={$dir}'\">" . @wsoPermsColor($dir . "/" . $link) . "</a>";
$file['pir2'] = "<a href='?sws=chmod&file={$link}&dir={$dir}'\">" . @perm($dir . "/" . $link) . "</a>";
$file['size'] = @number_format(@filesize($dir . "/" . $link) / 1024, 2);
@($file['link'] = "<a href='?sws=edit&file={$link}&dir={$dir}'\">" . $link . "</a>");
$file = "<tr><td>" . $file['link'] . "</td><td>" . $file['size'] . "</td><td>" . date('Y-m-d H:i:s', @filemtime($dir . "/" . $link)) . "</td><td>" . $on3['name'] . "/" . $gr['name'] . "</td><td>" . $file['pir'] . " " . $file['pir2'] . "<td><a href='?sws=edit&file={$link}&dir={$dir}'\">E</a> - <a href='?sws=rname&file={$link}&dir={$dir}'\">R</a> - <a href='?sws=chmod&file={$link}&dir={$dir}'\">C</a> - <a href='?sws=dow&file={$link}&dir={$dir}'\">D</a> - <a href='?sws=rm&file={$link}&dir={$dir}'\">rm</a></td></td></tr></div>";
array_push($files, $file);
}
}
asort($folders);
asort($files);
foreach ($folders as $folder) {
echo $folder;
}
foreach ($files as $file) {
echo $file;
}
echo "</table></div>";