public function __construct() { if (!pageArray(2)) { forward("admin/plugins"); } $guid = pageArray(2); adminGateKeeper(); $plugin = getEntity($guid); classGateKeeper($plugin, "Plugin"); $plugin->status = "disabled"; $plugin->save(); Cache::clear(); Cache::clear(); Admintab::deleteAll(); Setting::updateSettingsTable(); clearCache(); Cache::clear(); Systemvariable::set("setup_complete", false); $translations = getEntities(array("type" => "Translationentity")); if ($translations) { foreach ($translations as $translation) { $translation->delete(); } } new SystemMessage("Your plugin has been disabled."); forward("admin/plugins"); }
public function __construct() { $guid = pageArray(1); if (!$guid) { forward("profile/" . getLoggedInUserGuid()); } $user = getEntity($guid); classGateKeeper($user, "User"); $body = display("pages/profile", array("guid" => $guid)); $this->html = drawPage(NULL, $body); }
public function __construct() { $guid = pageArray(2); $entity = getEntity($guid); classGateKeeper($entity, "Videoalbum"); if (loggedInUserCanDelete($entity)) { $entity->delete(); } new SystemMessage('Your video album and all videos it contained have been deleted.'); forward("videos"); }
public function __construct() { $guid = pageArray(2); $video = getEntity($guid); classGateKeeper($video, "Video"); $album_guid = $video->container_guid; if (loggedInUserCanDelete($video)) { $video->delete(); new SystemMessage("Your video has been deleted."); } forward("videos/albums/view/{$album_guid}"); }
public function __construct() { $guid = pageArray(2); $request = getEntity($guid); classGateKeeper($request, "Friendrequest"); if ($request->ownerIsLoggedIn()) { $request->status = "withdrawn"; $request->save(); new SystemMessage("Your friend request has been withdrawn."); forward(); } }
public function __construct() { $guid = pageArray(2); $request = getEntity($guid); classGateKeeper($request, "Friendrequest"); if ($request->guid_two == getLoggedInUserGuid()) { $request->status = "declined"; $request->save(); new SystemMessage("You have successfully declined this friend request."); } forward(); }
function __construct() { gateKeeper(); $guid = pageArray(2); $blog = getEntity($guid); classGateKeeper($blog, "blog"); $owner_guid = $blog->owner_guid; if ($owner_guid == getLoggedInUserGuid()) { $blog->delete(); new SystemMessage("Your blog has been deleted"); forward("blogs"); } }
function __construct($data = NULL) { $guid = $data['guid']; if (!$guid) { $guid = pageArray(2); } $comment = getEntity($guid); classGateKeeper($comment, "Comment"); if (loggedInUserCanDelete($comment)) { $comment->delete(); } forward(); }
public function __construct() { if (!pageArray(2)) { return false; } $guid = pageArray(2); $file = getEntity($guid); classGateKeeper($file, "File"); if (getLoggedInUserGuid() == $file->owner_guid) { $file->delete(); } runHook("delete_file:redirect"); forward("files"); }
public function __construct() { runHook("send_verification_email:before"); $guid = getInput("guid"); $user = getEntity($guid); classGateKeeper($user, "User"); if ($user->verified == "true") { forward(); } Email::sendVerificationEmail($user); runHook("send_verification_email:after"); new SystemMessage(translate("system_message:verification_email_sent")); forward("home"); }
function __construct() { $guid = pageArray(2); $topic = getEntity($guid); classGateKeeper($topic, "Forumtopic"); if (loggedInUserCanDelete($topic)) { $topic->delete(); $comments = getEntities(array("type" => "Comment", "metadata_name" => "container_guid", "metadata_value" => $guid)); foreach ($comments as $comment) { $comment->delete(); } new SystemMessage("Your topic has been deleted."); forward(); } }
public function __construct($data) { $guid = $data['guid']; $notification = getEntity($guid); classGateKeeper($notification, "Notification"); if (!$data['session']) { if ($notification->owner_guid == getLoggedInUserGuid()) { $notification->delete(); } } else { $user = getUserFromSession($data['session']); if ($notification->owner_guid == $user->guid) { $notification->delete(); } } }
function __construct() { gateKeeper(); $to = getInput("to"); $from = getLoggedInUserGuid(); $subject = getInput("subject"); $message_body = getInput("message"); if (!$message_body) { new SystemMessage("Message body cannot be left blank."); forward(); } // Make sure recipient is a user $to_user = getEntity($to); classGateKeeper($to_user, "User"); // Make sure logged in user and to user are friends if (!FriendsPlugin::friends(getLoggedInUserGuid(), $to)) { forward(); } // Create a new message $message = new Message(); $message->to = $to; $message->from = $from; $message->subject = $subject; $message->save(); $message_element = new Messageelement(); $message_element->to = $to; $message_element->from = $from; $message_element->subject = $subject; $message_element->message = $message_body; $message_element->container_guid = $message->guid; $message_element->save(); $link = getSiteURL() . "messages"; $notify = $to_user->notify_when_message; if (!$notify) { $notify = "both"; } if ($notify == "both" || $notify == "site") { notifyUser("message", $to, $from, $to); } if ($notify == "both" || ($notify = "email")) { sendEmail(array("to" => array("name" => $to_user->full_name, "email" => $to_user->email), "from" => array("name" => getSiteName(), "email" => getSiteEmail()), "subject" => "You have a new message from " . getLoggedInUser()->full_name, "body" => "You have received a new message from " . getLoggedInUser()->full_name . "<br/><a href='{$link}'>Click here to view it.</a>", "html" => true)); } new SystemMessage("Your message has been sent."); forward(); }
* unless prior written permission is obtained from SocialApparatus. * * Contact Shane Barron admin@socia.us for more information. */ namespace SocialApparatus; denyDirect(); $guid = Vars::get("guid"); $buttons = NULL; $item_class = Vars::get("item_class"); if (!$item_class) { $item_class = "avatar_gallery"; } $link = Vars::get("link"); $file = getEntity($guid); classGateKeeper($file, "File"); $url = getSiteURL() . $file->getURL(); $owner_guid = $file->owner_guid; $owner = getEntity($owner_guid); $name = "<a href='" . $owner->getURL() . "'>" . $owner->first_name . " " . $owner->last_name . "</a>"; $view_type = Vars::get("view_type"); if (!$view_type) { $view_type = "list"; } $size = Vars::get("size"); if (!$size) { $size = MEDIUM; } $created = "Uploaded: by " . $name . " " . display("output/friendly_time", array("timestamp" => $file->time_created)); $icon = Image::getImageURL($file->guid, $size); $body_before = display("file/body_before", array("guid" => $guid));
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign * Patents, patents in process, and are protected by trade secret or copyright law. * * Dissemination of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from SocialApparatus. * * Contact Shane Barron admin@socia.us for more information. */ namespace SocialApparatus; denyDirect(); adminGateKeeper(); $requirements = ""; $guid = Vars::get('guid'); $plugin = getEntity($guid); classGateKeeper($plugin, "Plugin"); if ($plugin->requires) { if (isset($plugin->requires) && is_array($plugin->requires)) { foreach ($plugin->requires as $required_plugin) { $required_plugin_entity = Plugin::getPluginByName($required_plugin); if ($required_plugin_entity) { if ($required_plugin_entity->status == "enabled") { $requirements .= "<span class='enabled_plugin_link' onclick='sitejs.gotoplugin({$required_plugin_entity->guid})'>{$required_plugin}</span> , "; } else { $requirements .= "<span class='disabled_plugin_link' onclick='sitejs.gotoplugin({$required_plugin_entity->guid})'>{$required_plugin}</span> , "; } } } } $requirements = substr($requirements, 0, -3); }
* NOTICE: All information contained herein is, and remains the property of SocialApparatus * and its suppliers, if any. The intellectual and technical concepts contained herein * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign * Patents, patents in process, and are protected by trade secret or copyright law. * * Dissemination of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from SocialApparatus. * * Contact Shane Barron admin@socia.us for more information. */ namespace SocialApparatus; denyDirect(); $guid = Vars::get('guid'); $comment = getEntity($guid); classGateKeeper($comment, "Comment"); $owner_guid = $comment->owner_guid; $owner = getEntity($owner_guid); $url = $owner->getURL(); $icon = $owner->icon(SMALL); $time = display("output/friendly_time", array("timestamp" => $comment->time_created)); $delete_url = addTokenToURL(getSiteURL() . "action/deleteComment/{$guid}"); $button = $owner_guid == getLoggedInUserGuid() ? "<a href='{$delete_url}' class='btn btn-danger btn-xs pull-right confirm' data-toggle='tooltip' title='Delete'><i class='fa fa-times'></i></a>" : ""; $page = <<<HTML <li class='comment_{$guid}'> {$button} <div class="commenterImage"> <a href="{$url}" title="{$owner->first_name} {$owner->last_name}"> {$icon} </a> </div>
* SocialApparatus CONFIDENTIAL * __________________ * * [2002] - [2017] SocialApparatus (http://SocialApparatus.co) * All Rights Reserved. * * NOTICE: All information contained herein is, and remains the property of SocialApparatus * and its suppliers, if any. The intellectual and technical concepts contained herein * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign * Patents, patents in process, and are protected by trade secret or copyright law. * * Dissemination of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from SocialApparatus. * * Contact Shane Barron admin@socia.us for more information. */ namespace SocialApparatus; denyDirect(); $guid = pageArray(2); $group = getEntity($guid); classGateKeeper($group, "group"); $left = display("groups/left"); $middle = display("groups/middle"); $right = display("groups/right"); echo <<<HTML <div class='col-sm-4'>{$left}</div> <div class='col-sm-4'>{$middle}</div> <div class='col-sm-4'>{$right}</div> HTML ;