Esempio n. 1
0
<?php

if (!function_exists("cmsms")) {
    exit;
}
if (!$this->AccessAllowed() && !$this->AdvancedAccessAllowed()) {
    exit;
}
if (!isset($params["filename"]) || !isset($params["path"])) {
    $this->Redirect($id, 'defaultadmin');
}
if (filemanager_utils::test_invalid_path($params['path'])) {
    $this->Redirect($id, 'defaultadmin', $returnid, array("fmerror" => "fileoutsideuploads"));
}
$config =& $gCms->GetConfig();
$fullname = $this->Slash($params["path"], $params["filename"]);
$fullname = $this->Slash($config["root_path"], $fullname);
if (isset($params["newmode"])) {
    //echo deleting;die();
    if (isset($params["cancel"])) {
        $this->Redirect($id, "defaultadmin", $returnid, array("path" => $params["path"], "fmmessage" => "chmodcancelled"));
    } else {
        $newmode = $this->GetModeFromTable($params);
        if (isset($params["quickmode"]) && $params["quickmode"] != "") {
            $newmode = $params["quickmode"];
        }
        //echo $newmode;die();
        if ($this->SetMode($newmode, $fullname)) {
            $this->Redirect($id, "defaultadmin", $returnid, array("path" => $params["path"], "fmmessage" => "chmodsuccess"));
        } else {
            $this->Redirect($id, "defaultadmin", $returnid, array("path" => $params["path"], "fmerror" => "chmodfailure"));