本文整理汇总了PHP中AJXP_Logger::logAction方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Logger::logAction方法的具体用法?PHP AJXP_Logger::logAction怎么用?PHP AJXP_Logger::logAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Logger
的用法示例。
在下文中一共展示了AJXP_Logger::logAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catchError
function catchError($code, $message, $fichier, $ligne, $context)
{
if (error_reporting() == 0) {
return;
}
$message = "{$code} : {$message} in {$fichier} (l.{$ligne})";
AJXP_Logger::logAction("error", array("message" => $message));
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage(null, $message, true);
AJXP_XMLWriter::close();
exit(1);
}
示例2: switchAction
public function switchAction($action, $httpVars, $filesVars)
{
if (!isset($this->actions[$action])) {
return false;
}
$repository = ConfService::getRepository();
if (!$repository->detectStreamWrapper(true)) {
return false;
}
if (!isset($this->pluginConf)) {
$this->pluginConf = array("GENERATE_THUMBNAIL" => false);
}
$streamData = $repository->streamData;
$destStreamURL = $streamData["protocol"] . "://" . $repository->getId();
if ($action == "preview_data_proxy") {
$file = AJXP_Utils::decodeSecureMagic($httpVars["file"]);
if (isset($httpVars["get_thumb"]) && $this->pluginConf["GENERATE_THUMBNAIL"]) {
require_once INSTALL_PATH . "/plugins/editor.diaporama/PThumb.lib.php";
$pThumb = new PThumb($this->pluginConf["THUMBNAIL_QUALITY"]);
if (!$pThumb->isError()) {
$pThumb->remote_wrapper = $streamData["classname"];
$pThumb->use_cache = $this->pluginConf["USE_THUMBNAIL_CACHE"];
$pThumb->cache_dir = $this->pluginConf["THUMBNAIL_CACHE_DIR"];
$pThumb->fit_thumbnail($destStreamURL . $file, 200);
if ($pThumb->isError()) {
print_r($pThumb->error_array);
AJXP_Logger::logAction("error", $pThumb->error_array);
}
//exit(0);
} else {
print_r($pThumb->error_array);
AJXP_Logger::logAction("error", $pThumb->error_array);
}
} else {
$filesize = filesize($destStreamURL . $file);
$fp = fopen($destStreamURL . $file, "r");
header("Content-Type: " . AJXP_Utils::getImageMimeType(basename($file)) . "; name=\"" . basename($file) . "\"");
header("Content-Length: " . $filesize);
header('Cache-Control: public');
$class = $streamData["classname"];
$stream = fopen("php://output", "a");
call_user_func(array($streamData["classname"], "copyFileInStream"), $destStreamURL . $file, $stream);
fflush($stream);
fclose($stream);
//exit(1);
}
}
}
示例3: stream_open
/**
* Opens the stream
* Diff with parent class : do not "securePath", as it removes double slash
*
* @param String $path Maybe in the form "ajxp.fs://repositoryId/pathToFile"
* @param String $mode
* @param unknown_type $options
* @param unknown_type $opened_path
* @return unknown
*/
public function stream_open($path, $mode, $options, &$context)
{
try {
$this->realPath = $this->initPath($path, "file");
} catch (Exception $e) {
AJXP_Logger::logAction("error", array("message" => "Error while opening stream {$path}"));
return false;
}
if ($this->realPath == -1) {
$this->fp = -1;
return true;
} else {
$this->fp = fopen($this->realPath, $mode, $options);
return $this->fp !== false;
}
}
示例4: postProcess
public function postProcess($action, $httpVars, $params)
{
$url = $params["ob_output"];
if (!isset($this->pluginConf["BITLY_USER"]) || !isset($this->pluginConf["BITLY_APIKEY"])) {
print $url;
AJXP_Logger::logAction("error", "Bitly Shortener : you must drop the conf.shorten.bitly.inc file inside conf.php and set the login/api key!");
return;
}
$bitly_login = $this->pluginConf["BITLY_USER"];
$bitly_api = $this->pluginConf["BITLY_APIKEY"];
$format = 'json';
$version = '2.0.1';
$bitly = 'http://api.bit.ly/shorten?version=' . $version . '&longUrl=' . urlencode($url) . '&login=' . $bitly_login . '&apiKey=' . $bitly_api . '&format=' . $format;
$response = AJXP_Utils::getRemoteContent($bitly);
$json = json_decode($response, true);
if (isset($json['results'][$url]['shortUrl'])) {
print $json['results'][$url]['shortUrl'];
$this->updateMetaShort($httpVars["file"], $json['results'][$url]['shortUrl']);
} else {
print $url;
}
}
示例5: extractMeta
/**
*
* @param AJXP_Node $ajxpNode
*/
public function extractMeta(&$ajxpNode)
{
//if(isSet($_SESSION["SVN_COMMAND_RUNNING"]) && $_SESSION["SVN_COMMAND_RUNNING"] === true) return ;
$realDir = dirname($ajxpNode->getRealFile());
if (SvnManager::$svnListDir == $realDir) {
$entries = SvnManager::$svnListCache;
} else {
try {
SvnManager::$svnListDir = $realDir;
$entries = $this->svnListNode($realDir);
SvnManager::$svnListCache = $entries;
} catch (Exception $e) {
AJXP_Logger::logAction("Error", array($e->getMessage()));
}
}
$fileId = SystemTextEncoding::toUTF8(basename($ajxpNode->getUrl()));
if (isset($entries[$fileId])) {
$ajxpNode->mergeMetadata($entries[$fileId]);
}
}
示例6: storeFileToCopy
function storeFileToCopy($fileData)
{
$user = AuthService::getLoggedUser();
$files = $user->getTemporaryData("tmp_upload");
$files[] = $fileData;
AJXP_Logger::debug("Storing data", $fileData);
$user->saveTemporaryData("tmp_upload", $files);
if (strpos($_SERVER["HTTP_USER_AGENT"], "ajaxplorer-ios-client") !== false || strpos($_SERVER["HTTP_USER_AGENT"], "Apache-HttpClient") !== false) {
AJXP_Logger::logAction("Up from " . $_SERVER["HTTP_USER_AGENT"] . " - direct triger of next to remote");
$this->uploadActions("next_to_remote", array(), array());
}
}
示例7: deleteSelection
public function deleteSelection($actionName, &$httpVars, $filesVars)
{
$init = $this->initDirAndSelection($httpVars, array(), true);
if (isset($init["RECYCLE"]) && isset($init["RECYCLE"]["action"]) && $init["RECYCLE"]["action"] != "delete") {
$httpVars["dest"] = SystemTextEncoding::fromUTF8($init["RECYCLE"]["dest"]);
$this->copyOrMoveSelection("move", $httpVars, $filesVars);
$userSelection = $init["ORIGINAL_SELECTION"];
$files = $userSelection->getFiles();
if ($actionName == "delete") {
foreach ($files as $file) {
RecycleBinManager::fileToRecycle($file);
}
} else {
if ($actionName == "restore") {
foreach ($files as $file) {
RecycleBinManager::deleteFromRecycle($file);
}
}
}
$this->commitChanges($actionName, array("dir" => RecycleBinManager::getRelativeRecycle()), $filesVars);
return;
}
foreach ($init["SELECTION"] as $selectedFile) {
$res = ExecSvnCmd('svn delete', $selectedFile, '--force');
}
$this->commitMessageParams = "[" . implode(",", $init["SELECTION"]) . "]";
$this->commitChanges($actionName, $httpVars, $filesVars);
AJXP_Logger::logAction("Delete (svn delegate)", array("files" => $init["SELECTION"]));
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage("The selected files/folders have been deleted (by SVN)", null);
AJXP_XMLWriter::reloadDataNode();
AJXP_XMLWriter::close();
}
示例8: parseSpecificContributions
protected function parseSpecificContributions(&$contribNode)
{
parent::parseSpecificContributions($contribNode);
if (isset($this->actions["public_url"]) && (!is_dir(PUBLIC_DOWNLOAD_FOLDER) || !is_writable(PUBLIC_DOWNLOAD_FOLDER))) {
AJXP_Logger::logAction("Disabling Public links, PUBLIC_DOWNLOAD_FOLDER is not writeable!", array("folder" => PUBLIC_DOWNLOAD_FOLDER, "is_dir" => is_dir(PUBLIC_DOWNLOAD_FOLDER), "is_writeable" => is_writable(PUBLIC_DOWNLOAD_FOLDER)));
unset($this->actions["public_url"]);
$actionXpath = new DOMXPath($contribNode->ownerDocument);
$publicUrlNodeList = $actionXpath->query('action[@name="public_url"]', $contribNode);
$publicUrlNode = $publicUrlNodeList->item(0);
$contribNode->removeChild($publicUrlNode);
}
if ($this->detectStreamWrapper() !== false) {
$this->actions["cross_copy"] = array();
}
}
示例9: deleteUser
function deleteUser($userId)
{
$authDriver = ConfService::getAuthDriverImpl();
$confDriver = ConfService::getConfStorageImpl();
$authDriver->deleteUser($userId);
AJXP_User::deleteUser($userId);
AJXP_Logger::logAction("Delete User", array("user_id" => $userId));
return true;
}
示例10: checkPassword
function checkPassword($login, $pass, $seed)
{
//AJXP_Logger::logAction('auth.ldap:ldapAuthDriver::checkPassword');
$ret = ldap_search($this->ldapconn, $this->ldapDN, "uid=" . $login);
$entries = ldap_get_entries($this->ldapconn, $ret);
//error_log(print_r($entries, true));
if ($entries['count'] > 0) {
//AJXP_Logger::logAction('auth.ldap:Found user!');
//error_log(print_r($entries[0]["dn"], true));
if (@ldap_bind($this->ldapconn, $entries[0]["dn"], $pass)) {
AJXP_Logger::logAction('Ldap Password Check:Got user ' . $entries[0]["cn"][0]);
return true;
}
return false;
} else {
AJXP_Logger::logAction("Ldap Password Check:No user {$user_id} found");
return false;
}
}
示例11: deleteRepository
function deleteRepository($repoId)
{
$confStorage = ConfService::getConfStorageImpl();
$res = $confStorage->deleteRepository($repoId);
if ($res == -1) {
return $res;
}
global $G_DEFAULT_REPOSITORIES, $G_REPOSITORIES;
AJXP_Logger::logAction("Delete Repository", array("repo_id" => $repoId));
$G_REPOSITORIES = ConfService::initRepositoriesList($G_DEFAULT_REPOSITORIES);
}
示例12: switchAction
function switchAction($action, $httpVars, $fileVars)
{
if (!isset($this->actions[$action])) {
return;
}
$xmlBuffer = "";
foreach ($httpVars as $getName => $getValue) {
${$getName} = AJXP_Utils::securePath($getValue);
}
if (isset($dir) && $action != "upload") {
$dir = SystemTextEncoding::fromUTF8($dir);
}
$mess = ConfService::getMessages();
switch ($action) {
//------------------------------------
// SWITCH THE ROOT REPOSITORY
//------------------------------------
case "switch_repository":
if (!isset($repository_id)) {
break;
}
$dirList = ConfService::getRootDirsList();
if (!isset($dirList[$repository_id])) {
$errorMessage = "Trying to switch to an unkown repository!";
break;
}
ConfService::switchRootDir($repository_id);
// Load try to init the driver now, to trigger an exception
// if it's not loading right.
ConfService::loadRepositoryDriver();
if (AuthService::usersEnabled() && AuthService::getLoggedUser() != null) {
$user = AuthService::getLoggedUser();
$activeRepId = ConfService::getCurrentRootDirIndex();
$user->setArrayPref("history", "last_repository", $activeRepId);
$user->save();
}
//$logMessage = "Successfully Switched!";
AJXP_Logger::logAction("Switch Repository", array("rep. id" => $repository_id));
break;
//------------------------------------
// BOOKMARK BAR
//------------------------------------
//------------------------------------
// BOOKMARK BAR
//------------------------------------
case "get_bookmarks":
$bmUser = null;
if (AuthService::usersEnabled() && AuthService::getLoggedUser() != null) {
$bmUser = AuthService::getLoggedUser();
} else {
if (!AuthService::usersEnabled()) {
$confStorage = ConfService::getConfStorageImpl();
$bmUser = $confStorage->createUserObject("shared");
}
}
if ($bmUser == null) {
exit(1);
}
if (isset($_GET["bm_action"]) && isset($_GET["bm_path"])) {
if ($_GET["bm_action"] == "add_bookmark") {
$title = "";
if (isset($_GET["bm_title"])) {
$title = $_GET["bm_title"];
}
if ($title == "" && $_GET["bm_path"] == "/") {
$title = ConfService::getCurrentRootDirDisplay();
}
$bmUser->addBookMark(SystemTextEncoding::magicDequote($_GET["bm_path"]), SystemTextEncoding::magicDequote($title));
} else {
if ($_GET["bm_action"] == "delete_bookmark") {
$bmUser->removeBookmark($_GET["bm_path"]);
} else {
if ($_GET["bm_action"] == "rename_bookmark" && isset($_GET["bm_title"])) {
$bmUser->renameBookmark($_GET["bm_path"], $_GET["bm_title"]);
}
}
}
}
if (AuthService::usersEnabled() && AuthService::getLoggedUser() != null) {
$bmUser->save();
AuthService::updateUser($bmUser);
} else {
if (!AuthService::usersEnabled()) {
$bmUser->save();
}
}
AJXP_XMLWriter::header();
AJXP_XMLWriter::writeBookmarks($bmUser->getBookmarks());
AJXP_XMLWriter::close();
exit(1);
break;
//------------------------------------
// SAVE USER PREFERENCE
//------------------------------------
//------------------------------------
// SAVE USER PREFERENCE
//------------------------------------
case "save_user_pref":
$userObject = AuthService::getLoggedUser();
$i = 0;
//.........这里部分代码省略.........
示例13: generateJpegsCallback
public function generateJpegsCallback($masterFile, $targetFile)
{
$unoconv = false;
if (isset($this->pluginConf["UNOCONV"]) && !empty($this->pluginConf["UNOCONV"])) {
$unoconv = $this->pluginConf["UNOCONV"];
$officeExt = array('xls', 'xlsx', 'ods', 'doc', 'docx', 'odt', 'ppt', 'pptx', 'odp', 'rtf');
}
$extension = pathinfo($masterFile, PATHINFO_EXTENSION);
$node = new AJXP_Node($masterFile);
$masterFile = $node->getRealFile();
if (DIRECTORY_SEPARATOR == "\\") {
$masterFile = str_replace("/", "\\", $masterFile);
}
$wrappers = stream_get_wrappers();
$wrappers_re = '(' . join('|', $wrappers) . ')';
$isStream = preg_match("!^{$wrappers_re}://!", $targetFile) === 1;
if ($isStream) {
$backToStreamTarget = $targetFile;
$targetFile = tempnam(AJXP_Utils::getAjxpTmpDir(), "imagick_") . ".pdf";
}
$workingDir = dirname($targetFile);
$out = array();
$return = 0;
$tmpFileThumb = str_replace(".{$extension}", ".jpg", $targetFile);
if (DIRECTORY_SEPARATOR == "\\") {
$tmpFileThumb = str_replace("/", "\\", $tmpFileThumb);
}
if (!$this->extractAll) {
//register_shutdown_function("unlink", $tmpFileThumb);
} else {
@set_time_limit(90);
}
chdir($workingDir);
if ($unoconv !== false && in_array($extension, $officeExt)) {
$unoDoc = str_replace(".jpg", "_unoconv.pdf", $tmpFileThumb);
if (!is_file($tmpFileThumb)) {
// Create PDF Version now
$unoconv = "HOME=/tmp " . $this->pluginConf["UNOCONV"] . " --stdout -f pdf " . escapeshellarg($masterFile) . " > " . escapeshellarg(basename($unoDoc));
exec($unoconv, $out, $return);
}
if (is_file($unoDoc)) {
$masterFile = basename($unoDoc);
}
}
if ($this->onTheFly) {
$pageNumber = strrchr($targetFile, "-");
$pageNumber = str_replace(array(".jpg", "-"), "", $pageNumber);
$pageLimit = "[" . $pageNumber . "]";
$this->extractAll = true;
} else {
if (!$this->useOnTheFly) {
$pageLimit = $this->extractAll ? "" : "[0]";
} else {
$pageLimit = "[0]";
if ($this->extractAll) {
$tmpFileThumb = str_replace(".jpg", "-0.jpg", $tmpFileThumb);
}
}
}
$params = $this->extractAll ? "-quality " . $this->pluginConf["IM_VIEWER_QUALITY"] : "-resize 250 -quality " . $this->pluginConf["IM_THUMB_QUALITY"] . (isset($this->pluginConf["IM_CUSTOM_OPTIONS"]) ? " " . $this->pluginConf["IM_CUSTOM_OPTIONS"] : "");
$cmd = $this->pluginConf["IMAGE_MAGICK_CONVERT"] . " " . escapeshellarg($masterFile . $pageLimit) . " " . $params . " " . escapeshellarg($tmpFileThumb);
AJXP_Logger::logAction("IMagick Command : {$cmd}");
session_write_close();
// Be sure to give the hand back
exec($cmd, $out, $return);
if (is_array($out) && count($out)) {
throw new AJXP_Exception(implode("\n", $out));
}
if (!$this->extractAll) {
rename($tmpFileThumb, $targetFile);
if ($isStream) {
AJXP_Logger::debug("Copy preview file to remote", $backToStreamTarget);
copy($targetFile, $backToStreamTarget);
unlink($targetFile);
}
} else {
if ($isStream) {
if (is_file(str_replace(".{$extension}", "", $targetFile))) {
$targetFile = str_replace(".{$extension}", "", $targetFile);
}
if (is_file($targetFile)) {
AJXP_Logger::debug("Copy preview file to remote", $backToStreamTarget);
copy($targetFile, $backToStreamTarget);
unlink($targetFile);
}
AJXP_Logger::debug("Searching for ", str_replace(".jpg", "-0.jpg", $tmpFileThumb));
$i = 0;
while (file_exists(str_replace(".jpg", "-{$i}.jpg", $tmpFileThumb))) {
$page = str_replace(".jpg", "-{$i}.jpg", $tmpFileThumb);
$remote_page = str_replace(".{$extension}", "-{$i}.jpg", $backToStreamTarget);
AJXP_Logger::debug("Copy preview file to remote", $remote_page);
copy($page, $remote_page);
unlink($page);
$i++;
}
}
}
return true;
}
示例14: catchError
static function catchError($code, $message, $fichier, $ligne, $context)
{
if (error_reporting() == 0) {
return;
}
if (ConfService::getConf("SERVER_DEBUG")) {
$message = "{$message} in {$fichier} (l.{$ligne})";
}
AJXP_Logger::logAction("error", array("message" => $message));
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage(null, SystemTextEncoding::toUTF8($message), true);
AJXP_XMLWriter::close();
exit(1);
}
示例15: checkPassword
function checkPassword($login, $pass, $seed)
{
if (empty($pass)) {
return false;
}
$entries = $this->getUserEntries($login);
if ($entries['count'] > 0) {
if (@ldap_bind($this->ldapconn, $entries[0]["dn"], $pass)) {
AJXP_Logger::logAction('Ldap Password Check:Got user ' . $entries[0]["cn"][0]);
return true;
}
return false;
} else {
AJXP_Logger::logAction("Ldap Password Check:No user {$login} found");
return false;
}
}