Exemple #1
0
<?php

import('libs/plugins/array.php');
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // ワンタイムトークン
    if (!token('check')) {
        error('不正なアクセスです。');
    }
    // 入力データを整理
    $post = array('user' => normalize_users(array('id' => $_SESSION['auth']['user']['id'], 'username' => isset($_POST['username']) ? $_POST['username'] : '', 'password' => isset($_POST['password']) ? $_POST['password'] : '', 'password_confirm' => isset($_POST['password_confirm']) ? $_POST['password_confirm'] : '', 'email' => isset($_POST['email']) ? $_POST['email'] : '')), 'profile' => normalize_profiles(array('user_id' => $_SESSION['auth']['user']['id'], 'name' => isset($_POST['profile_name']) ? $_POST['profile_name'] : '', 'text' => isset($_POST['profile_text']) ? $_POST['profile_text'] : '')));
    // 入力データを検証&登録
    $warnings = validate_users($post['user']);
    $warnings += array_key_prefix(validate_profiles($post['profile']), 'profile_');
    if (isset($_POST['_type']) && $_POST['_type'] === 'json') {
        if (empty($warnings)) {
            ok();
        } else {
            warning($warnings);
        }
    } else {
        if (empty($warnings)) {
            $_SESSION['post']['user'] = $post['user'];
            $_SESSION['post']['profile'] = $post['profile'];
            // リダイレクト
            redirect('/user/modify_preview');
        } else {
            $_view['user'] = $post['user'];
            $_view['profile'] = $post['profile'];
            $_view['warnings'] = $warnings;
        }
    }
Exemple #2
0
        if (NULL === $item['installed_v']) {
            if (!isset($item['status_txt'])) {
                $item['status_txt'] = 'Inactive or not installed';
                $item['status_bg'] = '#DDDDDD';
            }
        } else {
            switch (version_compare($item['installed_v'], $item['version'])) {
                case -1:
                    $item['status_txt'] = _UPGRADE;
                    $item['status_bg'] = '#FFDDDD';
                    break;
                case 0:
                    $item['status_txt'] = _UPTODATE;
                    $item['status_bg'] = '#DDFFDD';
                    break;
                case 1:
                    $item['status_txt'] = 'CVS';
                    $item['status_bg'] = '#DDDDFF';
                    break;
            }
        }
        $item['description'] = decode_bb_all($item['description'], 0, true);
        $item['url_short'] = shrink_url($item['url']);
        $cpgtpl->assign_block_vars('channel.item', array_change_key_case(array_key_prefix($item, 's_'), CASE_UPPER));
    }
    // foreach item
}
// foreach channel
unset($data, $dir, $item, $IOthemes, $IOmodules);
$cpgtpl->set_handle('body', 'admin/plugins.html');
$cpgtpl->display('body');