本文整理汇总了PHP中Actions::checkUserUp方法的典型用法代码示例。如果您正苦于以下问题:PHP Actions::checkUserUp方法的具体用法?PHP Actions::checkUserUp怎么用?PHP Actions::checkUserUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actions
的用法示例。
在下文中一共展示了Actions::checkUserUp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadFile
/**
* upload file
*
* @param string $location where to upload
* @param string $thename file name
* @param string $tempname temp name
* @param string $tipo file type
*
* @return uploads file
*/
public static function uploadFile($location, $thename, $tempname, $tipo)
{
global $encodeExplorer;
$extension = File::getFileExtension($thename);
$filepathinfo = Utils::mbPathinfo($thename);
$name = Utils::normalizeStr($filepathinfo['filename']) . "." . $extension;
$upload_dir = $location->getFullPath();
$upload_file = $upload_dir . $name;
if (file_exists($upload_file)) {
Utils::setWarning("<span><i class=\"fa fa-info-circle\"></i> " . $name . " " . $encodeExplorer->getString("file_exists") . "</span> ");
} else {
$mime_type = $tipo;
$clean_file = $upload_dir . FileManager::safeExtension($name, $extension);
if (!$location->editAllowed() || !$location->isWritable()) {
Utils::setError("<span><i class=\"fa fa-exclamation-triangle\"></i> " . $encodeExplorer->getString("upload_not_allowed") . "</span> ");
} elseif (Utils::notList($mime_type, SetUp::getConfig("upload_allow_type")) == true || Utils::inList($extension, SetUp::getConfig("upload_reject_extension")) == true) {
Utils::setError("<span><i class=\"fa fa-exclamation-triangle\"></i> " . $name . "<strong>." . $extension . "</strong> " . $encodeExplorer->getString("upload_type_not_allowed") . "</span> ");
} elseif (!is_uploaded_file($tempname)) {
$encodeExplorer->setErrorString("failed_upload");
} elseif (!move_uploaded_file($tempname, $clean_file)) {
$encodeExplorer->setErrorString("failed_move");
} elseif (Actions::checkUserUp($clean_file) == false) {
$encodeExplorer->setErrorString("upload_exceeded");
unlink($clean_file);
} else {
chmod($clean_file, 0755);
//Actions::updateUserSpace($clean_file, true);
Utils::setSuccess("<span><i class=\"fa fa-check-circle\"></i> " . $name . "</span> ");
// file successfully uploaded, sending log notification
Logger::logCreation($location->getDir(true, false, false, 0) . $name, false);
}
}
}