public function testListProjects() { $projects = listProjects(self::$bigquery); echo 'Projects:'; foreach ($projects as $project) { echo $project->getFriendlyName(); } $this->assertGreaterThan(0, count($projects)); }
} else { echo returnErrorCode(3); } } else { echo returnErrorCode(2); } } else { echo returnErrorCode(1); } } else { if (isset($_GET['type']) && $_GET['type'] == "project" && isset($_GET['action']) && $_GET['action'] == "delete" && isset($_GET['project'])) { $project = htmlentities(mysql_real_escape_string($_GET['project'])); if (check($login) == 1) { if (authenticate($login, $password)) { if (deleteProject($login, $project)) { echo buildJSONResponse(array("create" => "ok", "deleted" => "ok", "projets" => listProjects($login))); } else { echo returnErrorCode(3); } } else { echo returnErrorCode(2); } } else { echo returnErrorCode(1); } } else { if (isset($_GET['type']) && $_GET['type'] == "file" && isset($_GET['action']) && $_GET['action'] == "create" && isset($_GET['project']) && isset($_GET['file'])) { $project = htmlentities(mysql_real_escape_string($_GET['project'])); $file = htmlentities(mysql_real_escape_string($_GET['file'])); if (check($login) == 1) { if (authenticate($login, $password) && isset($_POST['data']) && createFileData($login, $project, $file, base64_decode(htmlentities($_POST['data']))) == 1) {
function listProjects($path, $dir, $uri) { #$html.= "LIST PROJECTS : $path, $dir, $uri <br/>\n "; if (isset($dir) && $dir == "") { $html = '<div id="projects">'; } else { $html = "<div>"; } if (isset($dir) && $dir != "") { if ($dir == "drafts/") { $html .= '<a href="' . $uri . '" class="title">' . $dir . "</a><ul>\n"; } else { $html .= '<a href="' . $uri . '" class="title">' . $dir . '</a>' . "\n"; } } #print "should be trying to open : ".$path.$dir."<br/>"; if ($dh = opendir($path . $dir)) { //$html.= "opened directory : ".$path.$dir." <br/>"; while (($file = readdir($dh)) !== false) { if (interestingFile($file, $searchRegexp)) { if (is_dir($path . $dir . $file)) { if (file_exists($path . $dir . $file . "/" . $file . BLURB)) { $html .= printBlurb($path . $dir . $file . "/" . $file . BLURB, $file, $uri . $file . '/'); } else { $html .= listProjects($path . $dir, $file . '/', $uri . $file . '/'); } } else { if ($dir == "drafts/") { //Surely it is draft ??? $html .= "<li>" . guessDraftLinkList($path . $dir, $file, $uri) . "</li>\n"; } } } } closedir($dh); } else { $html .= "could not open this file : [" . $path . $dir . "]<br/>"; } if ($dir == "drafts/") { $html .= "</ul>\n"; } $html .= "</div>\n"; return $html; }
$login_status['human_error'] = "You're not logged in as a valid user to do this. Please log in and try again."; returnAjax($login_status); } switch ($admin_req) { # Stuff case 'save': returnAjax(saveEntry($_REQUEST)); break; case 'new': returnAjax(newEntry($_REQUEST)); break; case 'delete': returnAjax(deleteEntry($_REQUEST)); break; case 'list': returnAjax(listProjects(false)); break; case 'sulist': returnAjax(suListProjects(false)); break; case 'get': returnAjax(readProjectData($_REQUEST)); break; case 'edit_access': case 'editaccess': $link = $_REQUEST['project']; $deltas = smart_decode64($_REQUEST['deltas']); returnAjax(editAccess($link, $deltas)); break; case 'mint_data': case 'mint':