+
+ public function mayWriteLocally()
+ {
+ if ($GLOBALS['phorkie']['auth']['securityLevel'] == 0) {
+ //everyone may do everything
+ return true;
+ }
+
+ $logged_in = false;
+ if (!isset($_SESSION['identity'])) {
+ //not logged in
+ } else if ($GLOBALS['phorkie']['auth']['listedUsersOnly']) {
+ if (in_array($_SESSION['identity'], $GLOBALS['phorkie']['auth']['users'])) {
+ $logged_in = true;
+ }
+ } else {
+ //session identity exists, no special checks required
+ $logged_in = true;
+ }
+
+ return $logged_in;
+ }
+
+ public function getRepositoryEmbedCode(Repository $repo)
+ {
+ return '<script src="' . $repo->getLink('embed', null, true) . '"'
+ . ' id="phork-script-' . $repo->id . '"'
+ . ' type="text/javascript"></script>';
+ }