public function index($args) { $dat = new RetrieveModel(); $friend = new FriendModel(); $self = new OCSUser(); if (OCSUser::is_logged()) { EStructure::view("public_profile", $dat->getUserInfo($args[0]), $dat->getUserData(1), $friend->listFriends($self->login())); } }
public function test() { $total_time = 0; EStructure::view("header"); ETime::measure_from(); $client = new OCSClient(EConfig::$data["ocs"]["host"]); echo '<h3>Sanity OCS test</h3>'; echo '<p>config..........'; $check = $client->get("v1/config"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>person/check..........'; $postdata = array("login" => "test", "password" => "password"); $check = $client->post("v1/person/check", $postdata); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>person/add..........'; $postdata = array("login" => "cavolfiore", "password" => "cavolfiore", "email" => "*****@*****.**", "firstname" => "cavolf", "lastname" => "chiappe"); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $check = $client->post("v1/person/add", $postdata); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>person/data..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $check = $client->get("v1/person/data"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>person/data?name=cavol&page=1&pagesize=10..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $check = $client->get("v1/person/data?name=cavol&page=1&pagesize=10"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>person/data/[login]..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $check = $client->get("v1/person/data/cavolfiore"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>person/self..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $check = $client->get("v1/person/self"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>content/add..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $postdata = array("name" => "esempio", "type" => "0", "downloadname1" => "downloadname1", "downloadlink1" => "downloadlink1", "description" => "description", "summary" => "summary", "version" => "version", "changelog" => "changelog", "personid" => "test"); $client->set_auth_info("test", "password"); $check = $client->post("v1/content/add", $postdata); $contentid = $this->example_contentid = $check['ocs']['data']['content'][0]['id']; $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>content/categories..........'; $check = $client->get("v1/content/categories"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>content/licenses..........'; $check = $client->get("v1/content/licenses"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>content/data..........'; $check = $client->get("v1/content/data"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>content/data?search=esem..........'; $check = $client->get("v1/content/data?search=esem"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>content/data/[contentid]..........'; $check = $client->get("v1/content/data/{$contentid}"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>content/download/[contentid]/1..........'; $check = $client->get("v1/content/download/{$contentid}/1"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>content/vote/[contentid]..........'; $id = intval($contentid); $rate = floatval(1); $postdata = array("vote" => $rate); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $client->set_post_data($postdata); $check = $client->post("v1/content/vote/{$id}"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>content/edit/[contentid]..........'; $postdata = array("name" => "esempiomod", "summary" => "summarymod", "downloadname1" => "downloadname1mod", "downloadlink1" => "downloadlink1mod", "description" => "descriptionmod", "version" => "versionmod", "changelog" => "changelogmod"); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $client->set_post_data($postdata); $check = $client->post("v1/content/edit/{$id}"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>[get] activity..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $check = $client->get("v1/activity"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>[post] activity..........'; $postdata = array("message" => "coding is fun"); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $client->set_post_data($postdata); $check = $client->post("v1/activity"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>fan/add..........'; $postdata = array("idcontent" => $contentid); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $client->set_post_data($postdata); $check = $client->post("v1/fan/add/{$id}"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; ETime::measure_from(); echo '<p>fan/data/[contentid]..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $check = $client->get("v1/fan/data/{$id}"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; echo '<p>fan/status/[contentid]..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $check = $client->get("v1/fan/status/{$id}"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; echo '<p>fan/remove..........'; $postdata = array("idcontent" => $contentid); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $client->set_post_data($postdata); $check = $client->post("v1/fan/remove/{$id}"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; echo '<p>comments/add..........'; $postdata = array("type" => "1", "content" => $id, "content2" => "1", "parent" => "0", "subject" => "subject", "message" => "message"); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $client->set_post_data($postdata); $check = $client->post("v1/comments/add"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; echo '<p>comments/data/[type]/[contentid1]/[contentid2]..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); //$client->set_auth_info("test","password"); $check = $client->get("v1/comments/data/1/{$id}/1&page=1&pagesize=10"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; //deleting content used for tests echo '<p>content/delete/[contentid]..........'; $postdata = array("contentid" => $id); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $client->set_post_data($postdata); $check = $client->post("v1/content/delete/{$id}"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; /* * TODO: add to OCS specs more returncodes than just 100 */ echo '<p>friend/data/[personid]..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $check = $client->get("v1/friend/data/cavolfiore"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; /* * TODO: add to OCS specs more returncodes than just 100 */ echo '<p>friend/receivedinvitations..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $check = $client->get("v1/friend/receivedinvitations"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; /* * TODO: add to OCS specs more returncodes than just 100 */ echo '<p>friend/invite/[personid]..........'; $postdata = array("message" => "would you be my friend?"); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("test", "password"); $client->set_post_data($postdata); $check = $client->post("v1/friend/invite/cavolfiore "); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; echo '<p>friend/approve/[personid]..........'; $postdata = array("message" => "would you be my friend?"); $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("cavolfiore", "cavolfiore"); $client->set_post_data($postdata); $check = $client->post("v1/friend/approve/test"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; echo '<p>friend/decline/[personid]..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("cavolfiore", "cavolfiore"); $check = $client->post("v1/friend/decline/test"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )"; echo '<p>friend/cancel/[personid]..........'; $client = new OCSClient(EConfig::$data["ocs"]["host"]); $client->set_auth_info("cavolfiore", "cavolfiore"); $check = $client->post("v1/friend/cancel/test"); $this->_statuscode_test($check, $client); $time = ETime::measure_to(); $total_time += $time; echo "( {$time} )<br>"; echo "This OCS test took: {$total_time}"; EStructure::view("footer"); }
public function page($args) { $dat2 = new RetrieveModel(); $pag = new RetrieveModel(); EStructure::view("user_control_panel", $dat2->getSelfInfo(), $dat2->getUserData($args[0]), $dat2->getCategories()); }
public function show($args) { $cat = new RetrieveModel(); EStructure::view("app_description", $cat->getCategories(), $cat->getSingleContentData($args[0]), $cat->getComments($args[0])); }
" placeholder="host"></td></tr> <tr><td>User:</td><td><input type="text" name="user" value="<?php echo $data[0]['user']; ?> " placeholder="user"></td></tr> <tr><td>Password:</td><td><input type="password" name="password" value="<?php echo $data[0]['pass']; ?> " placeholder="password"></td></tr> <tr><td>Repeat password:</td><td><input type="password" name="password2" value="<?php echo $data[0]['pass2']; ?> " placeholder="repeat password"></td></tr> <tr><td colspan="2"><input style="float:right" type="submit" value="Try configuration"></td></tr> </form> <form action="/admin/steps/step2"> <tr><td colspan="2"><input style="float:right" type="submit" value="Next step ->" <?php if (!$data[0]['working']) { echo 'disabled="disabled"'; } ?> ></td></tr> </form> </table> <?php EStructure::view("footer");
<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/plasmastore/home/"><span><img class="logo" src="/plasmastore/img/plasma.png"/></span> PlasmaStore</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li><a href="#">Link <span class="sr-only">(current)</span></a></li> <li><a href="#">Link</a></li> </ul> <!--div class="col-md-4 col-md-offset-2 col-sm-3" !--> <form class="navbar-form navbar-center navbar-input-group" accept-charset="UTF-8" action="/plasmastore/search/search" method="post"> <input type="text" class="form-control" name="searchInput" placeholder="Search"> <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span> Go!</button> </form> <!--/div!--> <?php EStructure::view("login"); ?> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav>
public function page($args) { $pag = new RetrieveModel(); EStructure::view("category_showcase", $pag->getCategories(), $pag->getDataPerPage($args[0])); }
<div class="row"> <div class="col-lg-12"> <h1 class="page-header">Page Heading <small>Secondary Text</small> <?php //echo $data[1]["ocs"]["meta"]["totalitems"]; //echo "number of pages: ".ceil($data[1]["ocs"]["meta"]["totalitems"]/$data[1]["ocs"]["meta"]["itemsperpage"]); ?> </h1> </div> </div> <!-- /.row --> <!-- Project One --> <?php EStructure::view("applist", $data[1]); ?> <hr> <!-- Pagination --> <?php $pager1 = new Pager("home", "v1/content/data/"); //?pagesize=1" $pager1->pagination(); ?> <hr> </div> <!-- .col-md-7 col-md-offset-2 col-sm-offset-3-->
public function step3() { if ($this->arg_key('save')) { $pass1 = EHeaderDataParser::post('pass'); $pass2 = EHeaderDataParser::post('pass2'); if ($pass1 == $pass2) { $cf = new EConfigFile('generic'); $cf->set('password', $pass1); $cf->set('enabled', 'protected'); $cf->save(); } EStructure::view('wizard/step3save'); } else { $data = array(); if (isset(EConfig::$data['generic']['password'])) { $data['pass'] = EConfig::$data['generic']['password']; } else { $data['pass'] = ''; } EStructure::view('wizard/step3', $data); } }
public function index() { EStructure::view('welcome/index'); }
public function search($args) { $cat = new RetrieveModel(); $dat = new SearchModel(); EStructure::view("search", $cat->getCategories(), $dat->search()); }
<meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="ocs-server webclient"> <meta name="author" content="woffy"> <title>PlasmaStore</title> <link rel="stylesheet" href="/plasmastore/css/bootstrap.css"> <link rel="stylesheet" href="/plasmastore/css/dashboard.css"> <link rel="stylesheet" href="/plasmastore/css/logo.css"> <link rel="stylesheet" href="/plasmastore/css/app.css"> <link rel="stylesheet" href="/plasmastore/css/navbar-center.css"> <!--<link rel="stylesheet" href="css/responsive_preview.css">--> </head> <body> <?php EStructure::view("topbar"); ?> <div class="col-md-7 col-md-offset-2 col-sm-offset-3"> <div class="panel panel-default"> <div class="panel-body"> <?php echo "\n <h1 class=\"page-header\">Public profile of " . $data[0]["ocs"]["data"]["person"][0]["personid"] . "</h1>\n <h4>First Name: " . $data[0]["ocs"]["data"]["person"][0]["firstname"] . "</h4>\n <h4>Last Name: " . $data[0]["ocs"]["data"]["person"][0]["lastname"] . "</h4>\n <h4>Email: " . $data[0]["ocs"]["data"]["person"][0]["email"] . "</h4> \n <a class=\"btn btn-success\" href=\"/plasmastore/publicprofile/addFriend/" . $data[0]["ocs"]["data"]["person"][0]["personid"] . "\">Send friendship request</a>"; ?> </div> </div> </div> <!-- .col-md-7 col-md-offset-2 col-sm-offset-3-->
<html> <head> <?php EStructure::view("css"); ?> </head> <body> <div id="header"> <h1>OCS Server admin panel</h1> </div> <div id="nav"> <a href="/admin/status/index">Status</a><br> <a href="/admin/status/database">Database</a><br> <a href="/admin/status/categories">Categories</a><br> <a href="/admin/status/test">Sanity Test</a><br> <a href="/admin/status/logout">Logout</a><br> </div> <div id="section">
<link rel="stylesheet" href="/plasmastore/css/bootstrap.css"> <link rel="stylesheet" href="/plasmastore/css/dashboard.css"> <link rel="stylesheet" href="/plasmastore/css/logo.css"> <link rel="stylesheet" href="/plasmastore/css/app.css"> <link rel="stylesheet" href="/plasmastore/jRating/jquery/jRating.jquery.css"> <!--<link rel="stylesheet" href="css/responsive_preview.css">--> </head> <body> <?php EStructure::view("topbar"); ?> <div class="container-fluid"> <?php EStructure::view("categories_sidebar", $data[0]); ?> </div> <div class="col-md-7 col-md-offset-2 col-sm-offset-3"> <ol class="breadcrumb"> <?php echo "\n <li><a href=\"#\">Category 1</a></li>\n <li><a href=\"#\">Subcategory a</a></li>\n <li class=\"active\">" . $data[1]["ocs"]["data"]["content"][0]["name"] . "</li>\n "; ?> </ol> </div> <div class="col-md-7 col-md-offset-2 col-sm-offset-3"> <div class="thumbnail"> <div id="img_carousel" class="carousel slide" data-ride="carousel"> <!--indicators -->
public function index($args) { EStructure::view("main/main"); }