コード例 #1
0
ファイル: lib_group.php プロジェクト: mistgrass/geeklog-ivywe
function LIB_delete($pi_name)
{
    global $_CONF;
    global $_TABLES;
    $lang_box_admin = "LANG_" . strtoupper($pi_name) . "_ADMIN";
    global ${$lang_box_admin};
    $lang_box_admin = ${$lang_box_admin};
    $table = $_TABLES[strtoupper($pi_name) . '_def_group'];
    $id = COM_applyFilter($_POST['id'], true);
    // CHECK
    $err = "";
    //category addtionfield check!!!
    if ($err != "") {
        $pagetitle = $lang_box_admin['err'];
        $retval .= DATABOX_siteHeader($pi_name, '_admin', $page_title);
        $retval .= COM_startBlock($lang_box_admin['err'], '', COM_getBlockTemplate('_msg_block', 'header'));
        $retval .= $err;
        $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        $retval .= DATABOX_siteFooter($pi_name, '_admin');
        return $retval;
    }
    //
    DB_delete($table, 'group_id', $id);
    return COM_refresh($_CONF['site_admin_url'] . '/plugins/' . THIS_SCRIPT . '?msg=2');
}
コード例 #2
0
ファイル: download.php プロジェクト: mistgrass/geeklog-ivywe
$_USERBOX_VERBOSE = false;
// +---------------------------------------------------------------------------+
// MAIN
// +---------------------------------------------------------------------------+
//############################
$pi_name = 'userbox';
//############################
//
$display = '';
$page_title = $LANG_USERBOX_ADMIN['piname'];
//ログイン要否チェック
if (COM_isAnonUser()) {
    if ($_CONF['loginrequired'] or $_USERBOX_CONF['loginrequired'] == 3 or $_USERBOX_CONF['loginrequired'] == 2 and $id > 0) {
        $display .= DATABOX_siteHeader($pi_name, '', $page_title);
        $display .= SEC_loginRequiredForm();
        $display .= DATABOX_siteFooter($pi_name);
        COM_output($display);
        exit;
    }
}
//引数
//public_html/download.php?id=1&field_id=
$id = '';
if (isset($_REQUEST['id'])) {
    $id = COM_applyFilter($_REQUEST['id'], true);
}
$code = '';
if (isset($_REQUEST['code'])) {
    $code = COM_applyFilter($_REQUEST['code'], false);
}
$field_id = '';
コード例 #3
0
ファイル: lib_field.php プロジェクト: mistgrass/geeklog-ivywe
function LIB_delete($pi_name)
{
    global $_CONF;
    global $_TABLES;
    $lang_box_admin = "LANG_" . strtoupper($pi_name) . "_ADMIN";
    global ${$lang_box_admin};
    $lang_box_admin = ${$lang_box_admin};
    $table = $_TABLES[strtoupper($pi_name) . '_def_field'];
    $table2 = $_TABLES[strtoupper($pi_name) . '_addition'];
    $id = COM_applyFilter($_POST['id'], true);
    $type = COM_applyFilter($_POST['type']);
    // CHECK
    $err = "";
    if ($err != "") {
        $page_title = $lang_box_admin['err'];
        $retval .= DATABOX_siteHeader($pi_name, '_admin', $page_title);
        $retval .= COM_startBlock($lang_box_admin['err'], '', COM_getBlockTemplate('_msg_block', 'header'));
        $retval .= $err;
        $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        $retval .= DATABOX_siteFooter($pi_name, '_admin');
        return $retval;
    }
    //
    if ($type = 12) {
        $rt = DATABOX_deleteaddtionfiles_def($id, $pi_name);
        //外部ファイルの削除
    }
    DB_delete($table2, "field_id", $id);
    DB_delete($table, 'field_id', $id);
    return COM_refresh($_CONF['site_admin_url'] . '/plugins/' . THIS_SCRIPT . '?msg=2');
}
コード例 #4
0
ファイル: data.php プロジェクト: mistgrass/geeklog-ivywe
function fncdelete($template)
{
    global $_CONF;
    global $_TABLES;
    global $LANG_DATABOX_ADMIN;
    $pi_name = "databox";
    $id = COM_applyFilter($_POST['id'], true);
    $title = DB_getItem($_TABLES['DATABOX_base'], 'title', "id = " . $id);
    $addition_def = DATABOX_getadditiondef();
    //@@@@@
    $additionfields = $_POST['afield'];
    //@@@@@
    // CHECK
    $err = "";
    if ($err != "") {
        $page_title = $LANG_DATABOX_ADMIN['err'];
        $retval .= DATABOX_siteHeader('DATABOX', '_admin', $page_title);
        $retval .= COM_startBlock($LANG_DATABOX_ADMIN['err'], '', COM_getBlockTemplate('_msg_block', 'header'));
        $retval .= $err;
        $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        $retval .= DATABOX_siteFooter('DATABOX', '_admin');
        return $retval;
    }
    //
    $rt = databox_deletedata($id);
    $rt = fncsendmail('data_delete', $id, $title);
    $cacheInstance = 'databox__' . $id . '__';
    CACHE_remove_instance($cacheInstance);
    //exit;// debug 用
    $return_page = $_CONF['site_url'] . '/' . THIS_SCRIPT . '?msg=2';
    if ($template != "") {
        $return_page .= "&template=" . $template;
    }
    return COM_refresh($return_page);
}
コード例 #5
0
ファイル: profile.php プロジェクト: mistgrass/geeklog-ivywe
function fncdelete()
{
    global $_CONF;
    global $_TABLES;
    global $LANG_DATABOX_ADMIN;
    global $_USER;
    $pi_name = "userbox";
    $id = COM_applyFilter($_POST['id'], true);
    $username = DB_getItem($_TABLES['users'], "username", "uid={$id}");
    $email = DB_getItem($_TABLES['users'], "email", "uid={$id}");
    // CHECK
    $err = "";
    if ($err != "") {
        $page_title = $LANG_DATABOX_ADMIN['err'];
        $retval .= DATABOX_siteHeader($pi_name, '_admin', $page_title);
        $retval .= COM_startBlock($LANG_USERBOX_ADMIN['err'], '', COM_getBlockTemplate('_msg_block', 'header'));
        $retval .= $err;
        $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        $retval .= DATABOX_siteFooter($pi_name, '_admin');
        return $retval;
    }
    if (!USER_deleteAccount($id)) {
        $return_page = $_CONF['site_url'] . '/index.php';
    }
    $return_page = $_CONF['site_url'] . '/index.php?msg=57';
    $rt = fncsendmail('data_delete', $id, $username, $email);
    $cacheInstance = 'userbox__' . $id . '__';
    CACHE_remove_instance($cacheInstance);
    //exit;// debug 用
    return COM_refresh($return_page);
}
コード例 #6
0
function fncSave($navbarMenu, $menuno)
{
    global $_CONF;
    global $_TABLES;
    global $_USER;
    global $_USERBOX_CONF;
    global $LANG_USERBOX_user_menu;
    global $LANG_USERBOX_ADMIN;
    $pi_name = "userbox";
    $retval = '';
    //
    $groups = $_POST['groups'];
    $uid = $_USER['uid'];
    $groupsforuser = fncGetGroupsForUser();
    $whereGroups = 'ug_main_grp_id IN (' . implode(',', $groupsforuser) . ')';
    $sql = "DELETE FROM {$_TABLES['group_assignments']} WHERE ";
    $sql .= "(ug_uid = {$uid})  ";
    $sql .= " AND " . $whereGroups;
    DB_query($sql);
    if (is_array($groups)) {
        foreach ($groups as $userGroup) {
            //foreach( $groups as $fid => $fvalue ){
            //echo "fid=".$fid."  fvalue=".$fvalue."<br>";
            $sql = "INSERT INTO {$_TABLES['group_assignments']} ";
            $sql .= "(ug_main_grp_id, ug_uid) ";
            $sql .= "VALUES (";
            $sql .= " {$userGroup}";
            $sql .= ", {$uid}";
            $sql .= ")";
            DB_query($sql);
        }
    }
    //exit;// debug 用
    $id = $uid;
    if ($_USERBOX_CONF['aftersave'] === 'no') {
        $page_title = $LANG_USERBOX_ADMIN['piname'] . $LANG_USERBOX_ADMIN['edit'];
        $retval .= DATABOX_siteHeader($pi_name, '_admin', $page_title);
        $retval .= ppNavbarjp($navbarMenu, $LANG_USERBOX_user_menu[$menuno]);
        //$retval .= fncEdit($id, $edt_flg,1,$err);
        $retval .= fncEdit(1);
        $retval .= DATABOX_siteFooter($pi_name, '_admin');
        return $retval;
    } else {
        if ($_USERBOX_CONF['aftersave'] === 'list' or $_USERBOX_CONF['aftersave'] === 'admin') {
            $url = $_CONF['site_url'] . "/userbox/profile.php";
            $url .= "?";
            //コード使用の時
            if ($_USERBOX_CONF['datacode']) {
                $url .= "code=" . $username;
                $url .= "&amp;m=code";
            } else {
                $url .= "id=" . $id;
                $url .= "&amp;m=id";
            }
            $item_url = COM_buildUrl($url);
            $target = 'item';
        } else {
            $url = $_CONF['site_url'] . "/userbox/profile.php";
            $url .= "?";
            //コード使用の時
            if ($_USERBOX_CONF['datacode']) {
                $url .= "code=" . $username;
                $url .= "&amp;m=code";
            } else {
                $url .= "id=" . $id;
                $url .= "&amp;m=id";
            }
            $item_url = COM_buildUrl($url);
            $target = $_USERBOX_CONF['aftersave_admin'];
        }
    }
    // $return_page="";
    $return_page = PLG_afterSaveSwitch($target, $item_url, $pi_name, 1);
    echo $return_page;
    return;
}