function __construct()
 {
     adminGateKeeper();
     $ip = pageArray(2);
     if ($ip) {
         new BlacklistIp($ip);
         $params = array("type" => "User", "metadata_name_value_pairs" => array(array("name" => "ip1", "value" => $ip), array("name" => "ip2", "value" => $ip)), "metadata_name_value_pairs_operand" => "OR");
         $users = getEntities($params);
         $tables = Dbase::getAllTables(false);
         foreach ($users as $user) {
             new BlacklistEmail($user->email);
             $guid = $user->guid;
             foreach ($tables as $table) {
                 $entities = getEntities(array("type" => $table, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => $guid), array("name" => "container_guid", "value" => $guid)), "metadata_name_value_pairs_operand" => "OR"));
                 if ($entities) {
                     foreach ($entities as $entity) {
                         $entity->delete();
                     }
                 }
             }
             $user->delete();
         }
         new SystemMessage("Ip {$ip} has been banned, and all users using it have been deleted.");
         forward("home");
     }
 }
예제 #2
0
 * 
 * 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();
$content = NULL;
$tables = Dbase::getAllTables(false);
foreach ($tables as $key => $name) {
    if ($name != "entities") {
        $purge_url = addTokenToURL(getSiteURL() . "action/purgeTable/{$name}");
        $delete_url = addTokenToURL(getSiteURL() . "action/deleteTable/{$name}");
        $query = "SELECT COUNT(*) FROM `{$name}`";
        $results = Dbase::getResultsArray($query);
        if ($results) {
            $records = $results[0]['COUNT(*)'];
            $buttons = "<a href='{$purge_url}' class='btn btn-warning btn-xs confirm'>Purge</a>";
            if ($name != "User") {
                $buttons .= "<a href='{$delete_url}' class='btn btn-danger btn-xs confirm'>Delete</a>";
            }
            $content .= <<<HTML
<tr>
    <td>{$name}</td>
예제 #3
0
 public function delete()
 {
     Cache::delete("entity_" . $this->guid);
     $guid = $this->guid;
     $query = "DELETE FROM `" . strtolower($this->type) . "` WHERE `guid`='{$this->guid}'";
     Dbase::query($query);
     $query = "DELETE FROM `entities` WHERE `id`='{$this->guid}'";
     Dbase::query($query);
     $tables = Dbase::getAllTables();
     foreach ($tables as $table) {
         $query = "DELETE FROM {$table} WHERE `owner_guid` = '{$this->guid}'";
         Dbase::query($query);
         $query = "DELETE FROM {$table} WHERE `container_guid` = '{$this->guid}'";
         Dbase::query($query);
     }
     return true;
 }