Exemple #1
0
function findFile($name, $folder = null, $create = false)
{
    global $drive;
    $query = "name = '{$name}' and mimeType != 'application/vnd.google-apps.folder'";
    if (!empty($folder)) {
        if (is_string($folder)) {
            $query .= " and '" . $folder . "' in parents";
        } else {
            $query .= " and '" . $folder->getId() . "' in parents";
        }
    }
    $children = $drive->files->listFiles(array("q" => $query));
    if ($children && $children->getFiles() && count($children->getFiles())) {
        return $children->getFiles()[0];
    }
    if ($create === true) {
        return newFile($name, $folder);
    }
    return null;
}
Exemple #2
0
function processActions()
{
    $ftpAction = '';
    if (isset($_POST["ftpAction"]) && !empty($_POST["ftpAction"])) {
        $ftpAction = $_POST["ftpAction"];
    } elseif (isset($_GET["ftpAction"]) && !empty($_GET["ftpAction"])) {
        $ftpAction = $_GET["ftpAction"];
    } else {
        $ftpAction = 'error';
    }
    // Open folder (always called)
    if (openFolder() == 1) {
        // New file
        if ($ftpAction == "newFile") {
            newFile();
        }
        // New folder
        if ($ftpAction == "newFolder") {
            newFolder();
        }
        // Upload file
        if ($ftpAction == "upload") {
            uploadFile();
        }
        // Cut
        if ($ftpAction == "cut") {
            cutFilesPre();
        }
        // Copy
        if ($ftpAction == "copy") {
            copyFilesPre();
        }
        // Paste
        if ($ftpAction == "paste") {
            pasteFiles();
        }
        // Delete
        if ($ftpAction == "delete") {
            deleteFiles();
        }
        // Rename
        if ($ftpAction == "rename") {
            renameFiles();
        }
        // Chmod
        if ($ftpAction == "chmod") {
            chmodFiles();
        }
        // Drag & Drop
        if ($ftpAction == "dragDrop") {
            dragDropFiles();
        }
        // Edit
        if ($ftpAction == "edit") {
            editFile();
        }
    }
}
Exemple #3
0
AddHandler php5-script .php');

$_SESSION['installer']['server_base'] = $_REQUEST['serverurl'];
$_SESSION['installer']['admin_password'] = $_REQUEST['adminpw'];
$_SESSION['installer']['remote_cron_svc'] = $_REQUEST['pingsvc'];

$_SESSION['installer']['cfg']['service']['server'] = $_REQUEST['serverurl'];
$_SESSION['installer']['cfg']['service']['adminpw'] = $_REQUEST['adminpw'];
unset($_SESSION['installer']['cfg']['cron']);
$_SESSION['installer']['cfg']['ping']['remote'] = $_REQUEST['pingsvc'] == 'Y';
$_SESSION['installer']['cfg']['ping']['password'] = getDefault($_SESSION['installer']['cfg']['ping']['password'], randomHashId());
$_SESSION['installer']['cfg']['ping']['server'] = getDefault($_SESSION['installer']['cfg']['ping']['server'], 'http://ping.openfu.net');

if($_REQUEST['pingsvc'] == 'Y')
{
  newFile('conf/pingpassword', $_SESSION['installer']['cfg']['ping']['password']);
  $pingRequest = cqrequest($_SESSION['installer']['cfg']['ping']['server'], array('origin' => 'http://'.$_SESSION['installer']['server_base'].'/cron.php', 'request' => 'activate', 
    'password' => $_SESSION['installer']['cfg']['ping']['password']), 2);   
  unlink('conf/pingpassword');
  if($pingRequest['data']['result'] == 'OK')
  {
    $msg .= '<div class="green">✔ &nbsp; Joined remote ping service ('.$_SESSION['installer']['cfg']['ping']['server'].')</div>';
    $pingStatus = $pingRequest['data'];
    $pingStatus['server'] = $pingServer;
  }
  else
  {
    $pingStatus = array();
    $msg .= '<div class="red">✘ &nbsp; Could not establish a connection with ping server ('.$pingRequest['data']['reason'].')</div>';
  }
}
Exemple #4
0
        listClients();
        break;
    case 'editArticle':
        editArticle();
        break;
    case 'editPage':
        editPage();
        break;
    case 'deleteArticle':
        deleteArticle();
        break;
    case 'listPages':
        listPages();
        break;
    case 'newFile':
        newFile();
        break;
    case 'editFile':
        editFile();
        break;
    case 'listFiles':
        listFiles();
        break;
    case 'deleteFile':
        deleteFile();
        break;
    default:
        listArticles();
}
function login()
{