Exemplo n.º 1
0
$extp = cot_getextplugins('projects.add.first');
foreach ($extp as $pl) {
    include $pl;
}
/* ===== */
$sys['parser'] = $cfg['projects']['parser'];
$parser_list = cot_get_parsers();
if ($a == 'add') {
    cot_shield_protect();
    $ritem = array();
    /* === Hook === */
    foreach (cot_getextplugins('projects.add.add.first') as $pl) {
        include $pl;
    }
    /* ===== */
    $ritem = cot_projects_import('POST', array(), $usr);
    list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('projects', $ritem['item_cat']);
    cot_block($usr['auth_write']);
    /* === Hook === */
    foreach (cot_getextplugins('projects.add.add.import') as $pl) {
        include $pl;
    }
    /* ===== */
    cot_projects_validate($ritem);
    /* === Hook === */
    foreach (cot_getextplugins('projects.add.add.error') as $pl) {
        include $pl;
    }
    /* ===== */
    if (!cot_error_found()) {
        $id = cot_projects_add($ritem, $usr);
Exemplo n.º 2
0
    cot_die_message(404);
}
$sql = $db->query("SELECT * FROM {$db_projects} WHERE item_id='{$id}' LIMIT 1");
cot_die($sql->rowCount() == 0);
$item = $sql->fetch();
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('projects', $item['item_cat']);
cot_block($usr['isadmin'] || $usr['auth_write'] && $usr['id'] == $item['item_userid']);
$sys['parser'] = $item['item_parser'];
$parser_list = cot_get_parsers();
if ($a == 'update') {
    /* === Hook === */
    foreach (cot_getextplugins('projects.edit.update.first') as $pl) {
        include $pl;
    }
    /* ===== */
    $ritem = cot_projects_import('POST', $item, $usr);
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        $rdelete = cot_import('rdelete', 'P', 'BOL');
    } else {
        $rdelete = cot_import('delete', 'G', 'BOL');
        cot_check_xg();
    }
    if ($rdelete) {
        cot_projects_delete($id, $item);
        cot_redirect(cot_url('projects', "c=" . $item['item_cat'], '', true));
    }
    /* === Hook === */
    foreach (cot_getextplugins('projects.edit.update.import') as $pl) {
        include $pl;
    }
    /* ===== */