当前位置: 首页>>代码示例>>PHP>>正文


PHP Render::error方法代码示例

本文整理汇总了PHP中Render::error方法的典型用法代码示例。如果您正苦于以下问题:PHP Render::error方法的具体用法?PHP Render::error怎么用?PHP Render::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Render的用法示例。


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

示例1: antiTampering

 public static function antiTampering($tmplData)
 {
     //echo "Render::antiTampering()";
     Render::error($tmplData, "Detected tampering of data. Stop it!!");
     Render::login($tmplData);
     exit;
 }
开发者ID:Kloadut,项目名称:phpFileManager,代码行数:7,代码来源:Render.php

示例2: login

 public static function login(&$tmplData)
 {
     global $ini, $_POST, $_SESSION;
     if (!($_POST['username'] == $ini['userName'] && $_POST['password'] == $ini['password'])) {
         Render::error($tmplData, "The login details were incorrect");
         return false;
     } else {
         $_SESSION['user'] = $ini['userName'];
     }
     return true;
 }
开发者ID:Kloadut,项目名称:phpFileManager,代码行数:11,代码来源:Session.php

示例3: main

 public static function main($tmplData)
 {
     global $_REQUEST, $_GET, $_POST, $ini;
     //-----------------------------------------------------------------------------
     // Configuration variables
     //-----------------------------------------------------------------------------
     $newdirpermissions = 0700;
     // add the extensions of file types that you would like to be able to edit
     $editextensions = $ini['editableFileExtensions'];
     // add any file names to this array which should remain invisible
     $hiddenfiles = $ini['hiddenFiles'];
     // make this = false if you dont want the to use the edit function at all
     $editon = $ini['editFiles'] == 1;
     // make this = false if you dont want to be able to make directories
     $makediron = $ini['makeDir'] == 1;
     // make this = false if you dont want to be able to make directories
     $deletediron = $ini['deleteDir'] == 1;
     // directory path, must end with a '/'
     $path = $ini['basePath'];
     $type = $ini['fileTypes'];
     $fileiconCSS = $ini['fileIconCSS'];
     $foldericonCSS = $ini['folderIconCSS'];
     $hideCSS = $ini['hideCSS'];
     $showCSS = $ini['showCSS'];
     //-----------------------------------------------------------------------------
     // Data setup
     //
     // test the directory to see if it can be opened,
     // this is tested so that it does not try and open
     // and display the contents of directories which the user
     // does not have persmission to view
     //-----------------------------------------------------------------------------
     if ($_REQUEST['workingdir'] != '') {
         // remove the forward or backwards slash from the path
         $newpath = substr($path . $_REQUEST['workingdir'], 0, -1);
         $dir = @opendir($newpath);
         // if the directory could not be opened
         if ($dir == false) {
             // go back to displaying the previous screen
             $_GET['back'] = 1;
         } else {
             @closedir($dir);
         }
     }
     //echo "setup.";
     //-----------------------------------------------------------------------------
     // ACTION: Back link
     //-----------------------------------------------------------------------------
     if ($_GET['back'] != '') {
         $_REQUEST['workingdir'] = substr($_REQUEST['workingdir'], 0, -1);
         $slashpos = strrpos($_REQUEST['workingdir'], '/');
         if ($slashpos == 0) {
             $_REQUEST['workingdir'] = '';
         } else {
             $_REQUEST['workingdir'] = substr($_REQUEST['workingdir'], 0, $slashpos + 1);
         }
     }
     //echo "back link.";
     //-----------------------------------------------------------------------------
     // ACTION: File edit
     //-----------------------------------------------------------------------------
     if ($_GET['edit'] != '') {
         $fp = fopen($path . $_REQUEST['workingdir'] . $_GET['edit'], "r");
         $oldcontent = fread($fp, filesize($path . $_REQUEST['workingdir'] . $_GET['edit']));
         fclose($fp);
         $tmplData['{{workingdir}}'] = $_REQUEST['workingdir'];
         $tmplData['{{editingFile}}'] = $_GET['edit'];
         $tmplData['{{oldcontent}}'] = $oldcontent;
         Render::edit($tmplData);
     }
     //echo "edit.";
     //-----------------------------------------------------------------------------
     // ACTION: File upload
     //-----------------------------------------------------------------------------
     if ($_POST['upload'] != '') {
         // if a file was actually uploaded
         if ($_FILES['uploadedfile']['name'] != '') {
             // remove any % signs from the file name
             $_FILES['uploadedfile']['name'] = str_replace('%', '', $_FILES['uploadedfile']['name']);
             // if the file size is within allowed limits
             if ($_FILES['uploadedfile']['size'] > 0 && $_FILES['uploadedfile']['size'] < $maxfilesize) {
                 // put the file in the directory
                 move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $path . $_REQUEST['workingdir'] . $_FILES['uploadedfile']['name']);
                 Render::success($tmplData, "Uploaded file '" . $_REQUEST['workingdir'] . $_FILES['uploadedfile']['name'] . "' successfully.");
             } else {
                 $maxkb = round($maxfilesize / 1000);
                 // show the max file size in Kb
                 Render::error($tmplData, "The file was greater than the maximum allowed file size of {$maxkb} Kb and could not be uploaded.");
             }
         } else {
             Render::info($tmplData, "Please press the browse button and select a file to upload before you press the upload button.");
         }
     }
     //echo "upload.";
     //-----------------------------------------------------------------------------
     // ACTION: Edit file save
     //-----------------------------------------------------------------------------
     if ($_POST['save'] != '') {
         $newcontent = $_POST['newcontent'];
         $newcontent = stripslashes($newcontent);
//.........这里部分代码省略.........
开发者ID:Kloadut,项目名称:phpFileManager,代码行数:101,代码来源:Route.php


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