public function addfriend($args) { $friend = new FriendModel(); if (OCSUser::is_logged()) { var_dump($friend->sendRequest($args[0])); } }
<?php if (isset($data[0]["ocs"]["data"])) { foreach ($data[0]["ocs"]["data"]["content"] as $content) { echo "\n\t\t<div class=\"row\">\n\t\t\t<div class=\"col-md-7\">\n\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<img class=\"img-responsive\" src=\"" . $content["preview1"] . "\" alt=\"\">\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div class=\"col-md-5\">\n\t\t\t\t<h3>" . $content["name"] . "</h3>"; if (OCSUser::is_logged()) { echo "<a href=/plasmastore/publicprofile/" . $content["personid"] . "><h4>" . $content["personid"] . "</h4></a>"; } else { echo "<h4>" . $content["personid"] . "</h4>"; } echo "\n\t\t\t\t<p>" . $content["summary"] . "</p>\n\t\t\t\t<a class=\"btn btn-primary\" href=\"/plasmastore/app_description/show/" . $content["id"] . "/" . ERewriter::prettify($content["name"]) . "\">View Project <span class=\"glyphicon glyphicon-chevron-right\"></span></a>\n\t\t\t\t"; if (OCSUser::is_logged() && $_COOKIE["login"] == $content["personid"]) { echo "<a class=\"btn btn-danger\" href=\"/plasmastore/home/delData/" . $content["id"] . "\">Delete <span class=\"glyphicon glyphicon-trash\"></span></a>"; } echo "\n\t\t\t</div>\n\t\t</div> <hr>"; } }
/** * edit a content entry * @param string $format * @param string $contentid * @return string xml/json */ private function contentedit($format, $contentid) { $user = $this->checkpassword(true); $this->checktrafficlimit($user); $content = addslashes($contentid); $categories = EConfig::$data["ocs_categories"]; $numcats = count($categories); // fetch data $con = new OCSContent(); if ($con->load($content) and OCSUser::is_logged() and OCSUser::id() == $con->owner) { $data = array(); if ($this->readdata('name', 'text') != '') { $data['name'] = $this->readdata('name', 'text'); } if ($this->readdata('type', 'text') != '') { $data['type'] = $this->readdata('type', 'text'); } else { $data['type'] = $con->type; } if ($this->readdata('downloadname1', 'text') != $con->downloadname1) { $data['downloadname1'] = $this->readdata('downloadname1', 'text'); } if ($this->readdata('downloadlink1', 'text') != $con->downloadlink1) { $data['downloadlink1'] = $this->readdata('downloadlink1', 'text'); } if ($this->readdata('description', 'text') != '') { $data['description'] = $this->readdata('description', 'text'); } else { $data['description'] = '...'; } if ($this->readdata('summary', 'text') != '') { $data['summary'] = $this->readdata('summary', 'text'); } else { $data['summary'] = '...'; } if ($this->readdata('version', 'text') != '') { $data['version'] = $this->readdata('version', 'text'); } else { $data['version'] = '...'; } if ($this->readdata('changelog', 'text') != '') { $data['changelog'] = $this->readdata('changelog', 'text'); } else { $data['changelog'] = '...'; } if ($this->readdata('license', 'int') >= 0 or $this->readdata('license', 'int') < 5) { $data['license'] = $this->readdata('license', 'int'); } if ($data['name'] != '' or $data['type'] < 0 or $data['type'] > $numcats) { $con->update(array("name", "type", "downloadname1", "downloadlink1", "description", "summary", "version", "changelog", "license")); $xml = array(); $txt = $this->generatexml($format, 'ok', 100, '', $xml, 'content'); } else { $txt = $this->generatexml($format, 'failed', 101, 'please specify all mandatory fields'); } } else { $txt = $this->generatexml($format, 'failed', 102, 'no permission to change content'); } $con->updated(); echo $txt; }
<?php OCSUser::client_login(); if (!OCSUser::is_logged()) { echo "\n <form class=\"navbar-form navbar-right \" action=\"/plasmastore/login/prevpage\" method=\"post\">\n <div class=\"form-group\">\n <input type=\"text\" class=\"form-control\" name=\"login\" placeholder=\"Username\"> \n <input type=\"password\" class=\"form-control\" name=\"password\" placeholder=\"Password\">\n </div>\n <button type=\"submit\" class=\"btn btn-default\">Sign In</button>\n </form>"; } else { echo "\n <ul class=\"nav navbar-nav navbar-right\">\n <li class=\"dropdown\">\n <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-expanded=\"false\"><span class=\"glyphicon glyphicon-user\"></span>" . OCSUser::get_login() . "<span class=\"caret\"></span></a>\n <ul class=\"dropdown-menu\" role=\"menu\">\n <li><a href=\"/plasmastore/login/logout\"><span class=\"glyphicon glyphicon-log-out\"></span> Logout</a></li>\n <li><a href=\"#\"><span class=\"glyphicon glyphicon-send\"></span> My Messages</a></li>\n <li class=\"divider\"></li>\n <li><a href=\"/plasmastore/userpanel/\"> My Account</a></li>\n </ul>\n </li>\n </ul>"; } ?>