Exemplo n.º 1
0
 } else {
     if (isset($_REQUEST['delete'])) {
         $scriptid = get_request('scriptid', 0);
         $result = CScript::delete($scriptid);
         if ($result) {
             add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_SCRIPT, S_SCRIPT . ' [' . $scriptid . ']');
         }
         show_messages($result, S_SCRIPT_DELETED, S_CANNOT_DELETE_SCRIPT);
         if ($result) {
             unset($_REQUEST['form']);
             unset($_REQUEST['scriptid']);
         }
     } else {
         if ($_REQUEST['go'] == 'delete' && isset($_REQUEST['scripts'])) {
             $scriptids = $_REQUEST['scripts'];
             $go_result = CScript::delete($scriptids);
             if ($go_result) {
                 foreach ($scriptids as $snum => $scriptid) {
                     add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_SCRIPT, S_SCRIPT . ' [' . $scriptid . ']');
                 }
             }
             show_messages($go_result, S_SCRIPT_DELETED, S_CANNOT_DELETE_SCRIPT);
             if ($go_result) {
                 unset($_REQUEST['form']);
                 unset($_REQUEST['scriptid']);
             }
         }
     }
 }
 if ($_REQUEST['go'] != 'none' && isset($go_result) && $go_result) {
     $url = new CUrl();