Esempio n. 1
0
 /**
  * Checks if a button of the admin toolbar was pressed. Detected by looking for the
  * net_nehmer_comment_adminsubmit value in the Request.
  *
  * As of this point, this tool assumes at least owner level privileges for all
  */
 function _process_admintoolbar()
 {
     if (!array_key_exists('net_nehmer_comment_adminsubmit', $_REQUEST)) {
         // Nothing to do.
         return;
     }
     if (array_key_exists('action_delete', $_REQUEST)) {
         $comment = new net_nehmer_comments_comment($_REQUEST['guid']);
         if (!$comment->delete()) {
             throw new midcom_error(MIDCOM_ERRCRIT, "Failed to delete comment GUID '{$_REQUEST['guid']}': " . midcom_connection::get_error_string());
         }
         midcom::get('cache')->invalidate($comment->objectguid);
         $this->_relocate_to_self();
     }
 }