function update_action($par)
{
    if (isset($par['code']) && delete_action($par['code'])) {
        add_action($par);
    }
}
Beispiel #2
0
/**
*	точка входа в программу
*	подгружение model,controller.
*/
echo $_SERVER["REQUEST_URI"];
$uri = $_SERVER["REQUEST_URI"];
$u = explode('?', $uri);
$uri = $u[0];
echo "<br>newUri=" . $uri;
if ($uri == "/2ktvrp/subbotin/" or $uri == "/2ktvrp/subbotin/index.php") {
    $response = list_action();
} elseif ($uri == "/2ktvrp/subbotin/index.php/admin") {
    $response = admin_action();
} elseif ($uri == "/2ktvrp/subbotin/index.php/autor") {
    $response = autor_action();
} elseif ($uri == "/2ktvrp/subbotin/index.php/about") {
    $response = about_action();
} elseif ($uri == "/2ktvrp/subbotin/index.php/show") {
    $response = show_action($_REQUEST['id']);
} elseif ($uri == "/2ktvrp/subbotin/index.php/edit") {
    $response = edit_action($_REQUEST['id']);
} elseif ($uri == "/2ktvrp/subbotin/index.php/edit_submit") {
    $response = admin_action();
} elseif ($uri == "/2ktvrp/subbotin/index.php/delete") {
    $response = delete_action($_REQUEST['id']);
} elseif ($uri == "/2ktvrp/subbotin/index.php/add") {
    $response = add_action();
} elseif ($uri == "/2ktvrp/subbotin/index.php/users") {
    $response = users_action();
}
Beispiel #3
0
     } else {
         addresponse_display();
     }
     break;
 case 'delete':
     if (!$xhelp_isStaff) {
         redirect_header(XHELP_BASE_URL . "/" . basename(__FILE__), 3, _NOPERM);
     }
     /*
     if(!$hasRights = $xhelp_staff->checkRoleRights(XHELP_SEC_TICKET_DELETE)){
     $message = _XHELP_MESSAGE_NO_DELETE_TICKET;
     redirect_header(XHELP_BASE_URL."/".basename(__FILE__), 3, $message);
     }
     */
     if (isset($_POST['delete'])) {
         delete_action();
     } else {
         delete_display();
     }
     break;
 case 'anonMain':
     $config_handler =& xoops_gethandler('config');
     $xoopsConfigUser = array();
     $crit = new CriteriaCompo(new Criteria('conf_name', 'allow_register'), 'OR');
     $crit->add(new Criteria('conf_name', 'activation_type'), 'OR');
     $myConfigs =& $config_handler->getConfigs($crit);
     foreach ($myConfigs as $myConf) {
         $xoopsConfigUser[$myConf->getVar('conf_name')] = $myConf->getVar('conf_value');
     }
     if ($xoopsConfigUser['allow_register'] == 0) {
         header("Location: " . XHELP_BASE_URL . "/error.php");
Beispiel #4
0
                     $result = DBend($res);
                     if ($result && isset($res)) {
                         show_messages($result, S_STATUS_UPDATED, S_CANNOT_UPDATE_STATUS);
                         add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_ACTION, ' Actions [' . implode(',', $actionids) . '] ' . $status_name);
                     }
                 } else {
                     if ($_REQUEST['go'] == 'delete' && isset($_REQUEST['g_actionid'])) {
                         if (!count($nodes = get_accessible_nodes_by_user($USER_DETAILS, PERM_READ_WRITE, PERM_RES_IDS_ARRAY))) {
                             access_deny();
                         }
                         DBstart();
                         $actionids = array();
                         $sql = 'SELECT DISTINCT a.actionid ' . ' FROM actions a ' . ' WHERE ' . DBin_node('a.actionid', $nodes) . ' AND ' . DBcondition('a.actionid', $_REQUEST['g_actionid']);
                         $result = DBselect($sql);
                         while ($row = DBfetch($result)) {
                             $del_res = delete_action($row['actionid']);
                             if ($del_res) {
                                 $actionids[] = $row['actionid'];
                             }
                         }
                         $result = DBend();
                         if ($result && isset($del_res)) {
                             show_messages(TRUE, S_ACTIONS_DELETED, S_CANNOT_DELETE_ACTIONS);
                             add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_ACTION, ' Actions [' . implode(',', $actionids) . '] deleted');
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #5
0
     create_todo(filter_input(INPUT_POST, 'achievement_id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "create_work":
     create_work(filter_input(INPUT_POST, 'action_id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "deactivate_achievement":
     deactivate_achievement(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "does_username_already_exist":
     echo json_encode(does_username_already_exist(filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING)));
     break;
 case "remove_achievement":
     remove_achievement(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_action":
     delete_action(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_note":
     delete_note(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_relation":
     delete_relation(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_requirement":
     delete_requirement(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_tag":
     delete_tag(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_todo":
     delete_todo(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));