Esempio n. 1
0
     //,    'link', 'a/moderation/handle/', 'name');
     $dt->addColumn('owner', 'Owner', 'link', 'a/user/', 'name');
     $dt->addColumn('type', 'Type', 'array', getModerationTypes());
     $dt->addColumn('time_created', 'Created');
     $dt->addColumn('time_handled', 'Denied');
     $dt->addColumn('handled_by', 'Denied by', 'link', 'a/user/', 'name');
     $dt->addColumn('data', 'Data');
     $dt->addColumn('reference', 'Reference');
     $dt->setDataSource($list);
     echo $dt->render();
     break;
 case 'handle':
     if (!$this->child) {
         die('SADFGFG');
     }
     $o = ModerationObject::get($this->child);
     //    d($o);
     if (isset($_GET['approve']) || isset($_GET['deny'])) {
         $o->handled_by = $session->id;
         $o->time_handled = sql_datetime(time());
         $o->approved = isset($_GET['approve']) ? 1 : 0;
         $o->store();
         if (!isset($_GET['approve'])) {
             redir('a/moderation');
         }
         switch ($o->type) {
             case MODERATE_CHANGE_USERNAME:
                 if (UserFinder::byUsername($o->data)) {
                     return;
                 }
                 // perform the username switch