コード例 #1
0
ファイル: users.inc.php プロジェクト: noble82/proyectos-ULS
// $Id: users.inc.php,v 1.1 2008-10-20 14:10:00 dbellamy Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
$admin_layout = str_replace('!!menu_sous_rub!!', htmlentities($msg[26], ENT_QUOTES, $charset), $admin_layout);
print $admin_layout;
require_once './admin/users/users_func.inc.php';
print $admin_user_javascript;
switch ($action) {
    case 'pwd':
        include "./admin/users/user_pwd.inc.php";
        break;
    case 'modif':
        include "./admin/users/user_modif.inc.php";
        break;
    case 'update':
        include "./admin/users/user_update.inc.php";
        break;
    case 'add':
        echo window_title($database_window_title . $msg[347] . $msg[1003] . $msg[1001]);
        user_form("", "", "", 3, 0, "", 10, 10, 10, $form_param_default = "", "", "0", "0");
        echo form_focus('userform', 'form_login');
        break;
    case 'del':
        include "./admin/users/user_del.inc.php";
        break;
    default:
        echo window_title($database_window_title . $msg[25] . $msg[1003] . $msg[1001]);
        show_users($dbh);
        break;
}
コード例 #2
0
        $visibilite_expl_user .= "\n\t\t\t<div class='row'>\n\t\t\t\t<div class='colonne3' align='right'>" . $j["location_libelle"] . " : </div>\n\t\t\t\t<div class='colonne_suite'>&nbsp;<select name=\"form_expl_visibilite_" . $j["idlocation"] . "\">\n\t\t\t";
        $as_invis = array_search($j["idlocation"], $explr_tab_invis);
        $as_unmod = array_search($j["idlocation"], $explr_tab_unmod);
        $as_mod = array_search($j["idlocation"], $explr_tab_modif);
        $visibilite_expl_user .= "\n<option value='explr_invisible' " . ($as_invis !== FALSE && $as_invis !== NULL ? "selected='selected' " : "") . ">" . $msg["explr_invisible"] . "</option>";
        if ($as_mod !== FALSE && $as_mod !== NULL || $as_unmod !== FALSE && $as_unmod !== NULL || $as_invis !== FALSE && $as_invis !== NULL) {
            $visibilite_expl_user .= "\n<option value='explr_visible_unmod' " . ($as_unmod !== FALSE && $as_unmod !== NULL ? "selected='selected' " : "") . ">" . $msg["explr_visible_unmod"] . "</option>";
        } else {
            $visibilite_expl_user .= "\n<option value='explr_visible_unmod' selected='selected' >" . $msg["explr_visible_unmod"] . "</option>";
        }
        $visibilite_expl_user .= "\n<option value='explr_visible_mod' " . ($as_mod !== FALSE && $as_mod !== NULL ? "selected='selected' " : "") . ">" . $msg["explr_visible_mod"] . "</option>";
        $visibilite_expl_user .= "</select></div></div>\n";
    }
    pmb_mysql_free_result($resultat_droits_expl);
    if (!$explr_invisible && !$explr_visible_unmod && !$explr_visible_mod) {
        $rqt = "UPDATE users SET explr_invisible=0,explr_visible_mod=0,explr_visible_unmod='" . substr($temp, 0, strlen($temp) - 1) . "' WHERE userid={$id}";
        @pmb_mysql_query($rqt);
    }
    $deflt_user .= $visibilite_expl_user;
}
//fin visibilité des exemplaires
$param_default = "\n<div class='row'><hr /></div>\n\t\t{$param_user}\n\t<div class='row'><hr /></div>\n\t\t" . str_replace("!!param_allloc!!", $param_user_allloc, $deflt_user) . "\n\t<br />\n\t<div class='row'><hr /></div>\n\t\t{$value_user}\n\t<div class='row'><hr /></div>\n\t\t{$deflt_user_style}\n\t<br />";
if ($speci_user || $deflt3user) {
    $param_default .= "<div class='row'><hr /></div>";
    $param_default .= $deflt3user;
    $param_default .= $speci_user;
    $param_default .= "<div class='row'></div>";
}
echo window_title($msg[1003] . $msg[18] . $msg[1003] . $msg[86] . $msg[1003] . $usr->username . $msg[1001]);
user_form($usr->username, $usr->nom, $usr->prenom, $usr->rights, $usr->userid, $usr->user_lang, $usr->nb_per_page_search, $usr->nb_per_page_select, $usr->nb_per_page_gestion, $param_default, $usr->user_email, $usr->user_alert_resamail, $usr->user_alert_demandesmail, $usr->user_alert_subscribemail, $usr->user_alert_suggmail, $usr->grp_num);
echo form_focus('userform', 'form_nom');
コード例 #3
0
ファイル: edit.php プロジェクト: edgimopeter/ashp-cms
	<div class="row">

		<?php 
include 'sidebar.php';
?>

		<div class="col-md-10">
			<h2>Edit <?php 
echo $type;
?>
</h2>

				<?php 
switch ($type) {
    case 'User':
        echo user_form($id);
        break;
    case 'Activity Content':
        echo activity_content_form($id);
        break;
    case 'Faculty':
        echo faculty_form($id);
        break;
    case 'Activity':
        echo activity_form($id);
        break;
    case 'Stock File':
        echo stockfiles_form($id);
}
?>
			
コード例 #4
0
ファイル: add.php プロジェクト: edgimopeter/ashp-cms
		<?php 
include 'sidebar.php';
?>

		<div class="col-md-10">
			<h2>Add New <?php 
echo ucfirst($type);
?>
</h2>

				<?php 
switch ($type) {
    case 'user':
        if ($user->is_allowed('add_user')) {
            echo user_form();
        } else {
            echo edgimo_error('Your user role (' . $user->role . ') is not allowed to add new Users.');
        }
        break;
    case 'faculty':
        if ($user->is_allowed('add_faculty')) {
            echo faculty_form();
        } else {
            echo edgimo_error('Your user role (' . $user->role . ') is not allowed to add new Faculty.');
        }
        break;
    case 'activity':
        if ($user->is_allowed('add_activity')) {
            echo activity_form();
        } else {
コード例 #5
0
ファイル: admin_user.php プロジェクト: trabisdementia/xuups
function user_index($start = 0)
{
    global $xoopsTpl, $xoopsUser, $xoopsConfig, $limit;
    $myts =& MyTextSanitizer::getInstance();
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    $this_handler =& xoops_getModuleHandler('user', 'subscribers');
    $module_handler =& xoops_getHandler('module');
    $query = isset($_POST['query']) ? $_POST['query'] : null;
    $xoopsTpl->assign('query', $query);
    $criteria = null;
    if (!is_null($query)) {
        $criteria = new Criteria('user_email', $myts->addSlashes($query) . '%', 'LIKE');
    }
    $count = $this_handler->getCount($criteria);
    $xoopsTpl->assign('count', $count);
    $mHandler =& xoops_getHandler('member');
    $users_count = $mHandler->getUserCount(new Criteria('level', 0, '>'));
    $xoopsTpl->assign('users_count', $users_count);
    $xoopsTpl->assign('total_count', $users_count + $count);
    $criteria = new CriteriaCompo($criteria);
    $criteria->setSort('user_id');
    $criteria->setOrder('DESC');
    $criteria->setStart($start);
    $criteria->setLimit($limit);
    $objs = $this_handler->getObjects($criteria);
    unset($criteria);
    if ($count > 0) {
        if ($count > $limit) {
            include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
            $nav = new XoopsPageNav($count, $limit, $start, 'start', 'op=list');
            $xoopsTpl->assign('pag', '<div style="float:left; padding-top:2px;" align="center">' . $nav->renderNav() . '</div>');
        } else {
            $xoopsTpl->assign('pag', '');
        }
    } else {
        $xoopsTpl->assign('pag', '');
    }
    include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
    $countries = XoopsLists::getCountryList();
    foreach ($objs as $obj) {
        $objArray = $obj->toArray();
        $objArray['user_country'] = $countries[$objArray['user_country']];
        $xoopsTpl->append('objs', $objArray);
        unset($objArray);
    }
    $xoopsTpl->assign('add_form', user_form());
    return $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/subscribers/templates/static/subscribers_admin_user.html');
}
コード例 #6
0
ファイル: account.php プロジェクト: edgimopeter/ashp-cms
<?php

$title = 'Account Settings';
$slug = 'account';
require_once 'lib/functions.php';
include 'header.php';
?>

<div class="main">
	<div class="row">

		<?php 
include 'sidebar.php';
?>

		<div class="col-md-10">
			<h2>Account Settings</h2>

			<?php 
echo user_form(get_user_id_by_email($_SESSION['email']));
?>

		</div>
		
	</div>
</div>

<?php 
include 'footer.php';
コード例 #7
0
function user_validate_form()
{
    global $dbi;
    $does_password_needs_editing = !empty($_REQUEST['passHidden']);
    $ret = '<div style="color: red; padding: 5px;">';
    if (empty($_REQUEST['name'])) {
        $ret = $ret . 'Name required!<br/>';
    }
    if (empty($_REQUEST['uname'])) {
        $ret = $ret . 'User name required!<br/>';
    }
    if (empty($_REQUEST['pass']) && (empty($_REQUEST['uid']) || $does_password_needs_editing)) {
        $ret = $ret . 'Password required!<br/>';
    }
    $ret = $ret . '</div>';
    if (strcmp($ret, '<div style="color: red; padding: 5px;"></div>') == 0) {
        # valid
        $name = $_REQUEST['name'];
        $uname = $_REQUEST['uname'];
        $pass = md5($_REQUEST['pass']);
        $email = $_REQUEST['email'];
        $utype = $_REQUEST['utype'];
        $organisation = $_REQUEST['organisation'];
        $location = $_REQUEST['location'];
        $aclevel = $_REQUEST['aclevel'];
        $playerid = $utype == 0 ? $_REQUEST['playerid'] : 0;
        # if user is not a player ignore his player data connection
        $uactive = $_REQUEST['uactive'];
        $sql = 'INSERT INTO tuser (id, version, fullname, uname, pass, useraclevel, usertype_id, email, verein_id, theme, uactive, failcount, location_id, player_id) VALUES ';
        $sql = $sql . ' (0, 0, "' . $name . '", "' . $uname . '", "' . $pass . '", "' . $aclevel . '", ' . $utype . ', "' . $email . '", ' . (empty($organisation) ? '0' : $organisation) . ', "Lite", ' . $uactive . ', 0, ' . (empty($location) ? '0' : $location) . ', ' . $playerid . ') ';
        if (isset($_REQUEST['uid']) && !empty($_REQUEST['uid'])) {
            if ($does_password_needs_editing) {
                $pass_edit_sql = ' pass = "******", ';
            }
            $sql = 'UPDATE tuser SET ' . $pass_edit_sql . ' fullname = "' . $name . '", uname = "' . $uname . '", usertype_id = ' . $utype . ', email = "' . $email . '", verein_id = ' . $organisation;
            $sql = $sql . ', uactive = ' . $uactive . ', location_id = ' . $location . ', player_id = ' . $playerid . ' WHERE id = ' . $_REQUEST['uid'];
        }
        $insert_update_result = sql_query($sql, $dbi);
        if ($insert_update_result == TRUE) {
            $ret = $ret . '<script> window.location.href = "admin_system_users.php?op=new_user_created" </script>';
        } else {
            $ret = $ret . '<div style="color: red;">Creation/update of a user failed for unknown reasons!</div>';
        }
    } else {
        $ret = $ret . user_form();
    }
    return $ret;
}
コード例 #8
0
function user_form_save_action()
{
    //$_SESSION['wp_page'] = $_GET['page'];
    $current_user = wp_get_current_user();
    $user_name = isset($_POST['name']) ? $_POST['name'] : '';
    $user_email = isset($_POST['email']) && !empty($_POST['email']) ? $_POST['email'] : "";
    global $wpdb;
    $error = '';
    $table_name = $wpdb->prefix . 'users';
    $deactive_user_id = $wpdb->get_var('SELECT ID from ' . $table_name . ' where user_email="' . $_POST['email'] . '" AND user_status=-1');
    if ($deactive_user_id != '') {
        if (isset($_GET['page']) && $_GET['page'] != "") {
            if (isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])) {
                if ($error !== '') {
                    //$_SESSION['wp_page'] = $_GET['page'];
                    //$_SESSION['wp_errors']['my-contacts']['user_exists'] = $error;
                }
                set_site_message('my-contacts', 'success', "Contact Added Successfully");
                if (active_user($user_email)) {
                    wp_redirect(base64_decode($_POST['redirect_url']) . '?page=' . $_GET['page']);
                }
            } else {
                wp_redirect(admin_url() . "admin.php?page=" . $_GET['page']);
            }
        } else {
            $success = "Contact Added Successfully";
            $error = '';
            if (active_user($user_email)) {
                user_form($error, $success, $deactive_user_id, $_POST['label']);
            }
        }
        die;
    }
    $is_update = false;
    if ($_POST['id'] == 0) {
        remove_filter('profile_update', 'numediaweb_custom_user_profile_fields', 20);
        if (!email_exists($user_email)) {
            $random_password = wp_generate_password($length = 12, $include_standard_special_chars = false);
            /* 0846 - 08/06/15 - in place of user_name in below function we take user_email because we change the functionality to take user_name as user_email */
            $user_id = @wp_create_user($user_email, $random_password, $user_email);
            //$user_id = wp_update_user(array('first_name' => $_POST['fname'], 'last_name' => $_POST['lname'], 'ID' => $user_id));
            $user = get_user_by('id', $user_id);
            $wpdb->query("update " . $wpdb->prefix . "users set display_name = '" . $_POST['fname'] . " " . $_POST['lname'] . "', first_name = '" . $_POST['fname'] . "',last_name='" . $_POST['lname'] . "',salutaions='" . $_POST['salutaions'] . "', phone = '" . $_POST['phone'] . "', country=" . $_POST['country'] . ",state=" . $_POST['state'] . ",city='" . $_POST['city'] . "', title = '" . $_POST['title'] . "', fax = '" . $_POST['fax'] . "', address = '" . $_POST['address'] . "', created_by = " . get_current_user_id() . ", created_on = '" . date("Y-m-d H:m:s") . "', company_id = '" . $_POST['company_id'] . "' where ID=" . $user_id);
            $get_current_user_role_new = get_current_user_role();
            $bnfw = BNFW::factory();
            if (strtolower($get_current_user_role_new) != 'staff') {
                $sql = 'SELECT * FROM ' . $wpdb->prefix . 'users where ID=' . get_current_user_id();
                $result_user = $wpdb->get_results($sql);
                $link_to_users = get_permalink(get_page_by_path('listings')) . '?page=my-contacts';
                if ($bnfw->notifier->notification_exists('new-contact')) {
                    $notifications = $bnfw->notifier->get_notifications('new-contact');
                    foreach ($notifications as $notification) {
                        $setting = $bnfw->notifier->read_settings($notification->ID);
                        foreach ($setting['users'] as $users_role) {
                            $main_role = strtolower(str_replace('role-', '', $users_role));
                            $sql = "select `user_email` from " . $wpdb->prefix . "users where `user_type` = '" . $main_role . "'";
                            $staff_user = $wpdb->get_results($sql);
                            foreach ($staff_user as $staff_user) {
                                $emailstaff = $staff_user->user_email;
                                $display_name = isset($staff_user->display_name) ? $staff_user->display_name : '';
                                $usernamestaff = ucwords($display_name);
                                $subjectstaff = $setting['subject'];
                                $date = date('Y-m-d');
                                $messagestaff = $setting['message'];
                                $messagestaff = str_replace('[firstuser]', $_POST['fname'], $messagestaff);
                                $messagestaff = str_replace('[lastuser]', $_POST['lname'], $messagestaff);
                                $messagestaff = str_replace('[firstname]', $result_user[0]->first_name, $messagestaff);
                                $messagestaff = str_replace('[lastname]', $result_user[0]->last_name, $messagestaff);
                                $messagestaff = str_replace('[username]', $usernamestaff, $messagestaff);
                                $messagestaff = str_replace('[date]', $date, $messagestaff);
                                $messagestaff = str_replace('[linkToUser]', $link_to_users, $messagestaff);
                                $subjectstaff = str_replace('[firstname]', $result_user[0]->first_name, $subjectstaff);
                                $subjectstaff = str_replace('[lastname]', $result_user[0]->last_name, $subjectstaff);
                                wp_mail($emailstaff, $subjectstaff, wpautop($messagestaff));
                            }
                        }
                    }
                }
            }
            if ($bnfw->notifier->notification_exists('new-contact-to-customer')) {
                $notifications = $bnfw->notifier->get_notifications('new-contact-to-customer');
                foreach ($notifications as $notification) {
                    $setting = $bnfw->notifier->read_settings($notification->ID);
                    $emailcustomer = $current_user->user_email;
                    $subjectcustomer = $setting['subject'];
                    $date = date('Y-m-d');
                    $messagecustomer = $setting['message'];
                    $messagecustomer = str_replace('[firstuser]', $_POST['fname'], $messagecustomer);
                    $messagecustomer = str_replace('[lastuser]', $_POST['lname'], $messagecustomer);
                    $messagecustomer = str_replace('[firstname]', ucfirst($result_user[0]->first_name), $messagecustomer);
                    $messagecustomer = str_replace('[lastname]', $result_user[0]->last_name, $messagecustomer);
                    $messagecustomer = str_replace('[date]', $date, $messagecustomer);
                    $messagecustomer = str_replace('[linkToUser]', $link_to_users, $messagecustomer);
                    $subjectcustomer = str_replace('[firstname]', $result_user[0]->first_name, $subjectcustomer);
                    $subjectcustomer = str_replace('[lastname]', $result_user[0]->last_name, $subjectcustomer);
                    wp_mail($emailcustomer, $subjectcustomer, wpautop($messagecustomer));
                }
            }
            $error = '';
            $success = 'User added successfully';
            if (isset($_GET['page']) && $_GET['page'] != "") {
                set_site_message('my-contacts', 'success', "Contact Added Successfully");
            }
            //$_SESSION['wp_notices']['user_added'] = __('Contact added successfully.');
            //$_SESSION['wp_page'] = $_GET['page'];
        } else {
            if (isset($_POST['label']) && !empty($_POST['label']) && $_POST['label'] == 'applicantbillingid') {
                $user = get_user_by('email', $_POST['email']);
                $is_billing_exist_for_application = $wpdb->get_row("select * from " . $wpdb->prefix . "application_user_roles where user_id = " . $user->data->ID . " and application_id = " . $_POST['application_id']);
                if (empty($is_billing_exist_for_application)) {
                    if (!empty($user)) {
                        $wpdb->insert($wpdb->prefix . 'application_user_roles', array('user_id' => $user->data->ID, 'application_id' => $_POST['application_id'], 'roles' => serialize(array(array("billing" => 1)))));
                    }
                    $error = '';
                    $success = 'User added successfully';
                    user_form($error, $success, $user->data->ID, $_POST['label']);
                    $user_id = $user->data->ID;
                } else {
                    if (isset($_GET['page']) && $_GET['page'] != "") {
                        set_site_message('my-contacts', 'error', "Contact already exists");
                    }
                    $error = 'This user already assign as billing for this application.';
                    $success = '';
                    $user_id = '';
                }
            } else {
                if (isset($_GET['page']) && $_GET['page'] != "") {
                    set_site_message('my-contacts', 'error', "Contact already exists");
                }
                $error = 'Contact already exists.';
                $success = '';
                $user_id = '';
            }
            //$_SESSION['wp_errors']['user_exists'] = __('User already exists.  Password inherited.');
            //wp_redirect(admin_url()."/admin-post.php?page=my-contacts&error=".$error);
        }
    } else {
        $user = get_user_by('id', trim($_POST['id']));
        $user_info = get_userdata($user->ID);
        $user_role = implode(', ', $user_info->roles);
        $u = new WP_User($user->ID);
        $roles = get_user_meta($_POST['id'], "wp_capabilities");
        $dataarray = array('salutaions' => $_POST['salutaions'], 'display_name' => $_POST['fname'] . " " . $_POST['lname'], 'phone' => $_POST['phone'], 'country' => $_POST['country'], 'state' => $_POST['state'], 'city' => $_POST['city'], 'zipcode' => $_POST['zipcode'], 'first_name' => $_POST['fname'], 'last_name' => $_POST['lname'], 'title' => $_POST['title'], 'fax' => $_POST['fax'], 'address' => $_POST['address'], 'modified_by' => get_current_user_id(), 'modified_on' => date("Y-m-d H:m:s"));
        $wpdb->update($table_name, $dataarray, array('id' => $_POST['id']));
        $get_current_user_role_new = get_current_user_role();
        if (strtolower($get_current_user_role_new) != 'staff') {
            $sql = 'SELECT * FROM ' . $wpdb->prefix . 'users where ID=' . get_current_user_id();
            $result_user = $wpdb->get_results($sql);
            $link_to_users = get_permalink(get_page_by_path('listings')) . '?page=my-contacts';
            $bnfw = BNFW::factory();
            if ($bnfw->notifier->notification_exists('new-contact-update')) {
                $notifications = $bnfw->notifier->get_notifications('new-contact-update');
                foreach ($notifications as $notification) {
                    $setting = $bnfw->notifier->read_settings($notification->ID);
                    foreach ($setting['users'] as $users_role) {
                        $main_role = strtolower(str_replace('role-', '', $users_role));
                        $sql = "select `user_email` from " . $wpdb->prefix . "users where `user_type` = '" . $main_role . "'";
                        $staff_user = $wpdb->get_results($sql);
                        foreach ($staff_user as $staff_user) {
                            $emailstaff = $staff_user->user_email;
                            $subjectstaff = $setting['subject'];
                            $date = date('Y-m-d');
                            $messagestaff = $setting['message'];
                            $messagestaff = str_replace('[firstuser]', $_POST['fname'], $messagestaff);
                            $messagestaff = str_replace('[lastuser]', $_POST['lname'], $messagestaff);
                            $messagestaff = str_replace('[firstname]', $result_user[0]->first_name, $messagestaff);
                            $messagestaff = str_replace('[lastname]', $result_user[0]->last_name, $messagestaff);
                            $messagestaff = str_replace('[date]', $date, $messagestaff);
                            $messagestaff = str_replace('[linkToUser]', $link_to_users, $messagestaff);
                            $subjectstaff = str_replace('[firstname]', $result_user[0]->first_name, $subjectstaff);
                            $subjectstaff = str_replace('[lastname]', $result_user[0]->last_name, $subjectstaff);
                            wp_mail($emailstaff, $subjectstaff, wpautop($messagestaff));
                        }
                    }
                }
            }
        }
        if (isset($user_info->crm_id) && !empty($user_info)) {
            $is_update = true;
            createRole('modified', 'Modified', array('read' => true, 'application-form' => false));
            //create modified role
            $user_info->add_role('modified');
        }
        $user_id = $_POST['id'];
        //$_SESSION['wp_page'] = $_GET['page'];
        set_site_message('my-contacts', 'success', "Contact Details Updated Successfully");
        //  $_SESSION['wp_notices']['user_updated'] = __("Contact Updated Successfully");
    }
    if (empty($error)) {
        $roles = get_user_meta($current_user->ID, "wp_capabilities");
        if (!empty($roles) && isset($roles[0]) && array_key_exists('staff', $roles[0])) {
            try {
                approve_user_by_staff($user_id, $is_update);
            } catch (Exception $e) {
                $error = "CRM approve error " . $e->getMessage();
            }
        }
    }
    if (isset($_GET['page']) && $_GET['page'] != "") {
        if (isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])) {
            if ($error !== '') {
                //$_SESSION['wp_page'] = $_GET['page'];
                //$_SESSION['wp_errors']['my-contacts']['user_exists'] = $error;
            }
            wp_redirect(base64_decode($_POST['redirect_url']) . '?page=' . $_GET['page']);
        } else {
            wp_redirect(admin_url() . "admin.php?page=" . $_GET['page']);
        }
    } else {
        user_form($error, $success, $user_id, $_POST['label']);
    }
}
コード例 #9
0
ファイル: users.php プロジェクト: JustineBABY/rmcommon
            $online_handler =& xoops_gethandler('online');
            $online_handler->destroy($uid);
            // RMV-NOTIFY
            xoops_notification_deletebyuser($uid);
        }
    }
    redirectMsg("users.php?" . $q, __('Users deleted successfully!', 'rmcommon'), 0);
}
// get the action
$action = RMHttpRequest::request('action', 'string', '');
switch ($action) {
    case 'new':
        user_form();
        break;
    case 'edit':
        user_form(true);
        break;
    case 'save':
        save_data();
        break;
    case 'saveedit':
        save_data(true);
        break;
    case 'mailer':
        show_mailer();
        break;
    case 'sendmail':
        send_mail();
        break;
    case 'deactivate':
        activate_users(0);
コード例 #10
0
ファイル: matchreport.php プロジェクト: testt98/ebattles
            break;
    }
    switch ($action) {
        case 'matchreport':
        case 'matchscheduledreport':
        case 'matchedit':
        case 'matchschedulededit':
        case 'matchschedule':
            if (!check_class(e_UC_MEMBER)) {
                $text .= '<p>' . EB_MATCHR_L36 . '</p>';
                $text .= '<p>' . EB_MATCHR_L34 . ' [<a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $event_id . '">' . $event->getField('Name') . '</a>]</p>';
            } else {
                if ($show_report_form == 1) {
                    $userclass = $_POST['userclass'];
                    // the form has not been submitted, let's show it
                    user_form($action, $players_id, $players_name, $event_id, $match_id, $event->getField('AllowDraw'), $event->getField('AllowForfeit'), $event->getField('AllowScore'), $userclass, $date_scheduled, $user_player);
                } else {
                    $text .= '<p>' . EB_MATCHR_L33 . '</p>';
                    //dbg:$text .= 'userlass='.$userclass;
                    //$text .= '<p>'.EB_MATCHR_L34.' [<a href="'.e_PLUGIN.'ebattles/eventinfo.php?eventid='.$event_id.'">'.$event->getField('Name').'</a>]</p>';
                }
            }
            break;
        default:
            $text .= '<p>' . EB_MATCHR_L33 . '</p>';
            //$text .= '<p>'.EB_MATCHR_L34.' [<a href="'.e_PLUGIN.'ebattles/eventinfo.php?eventid='.$event_id.'">'.$event->getField('Name').'</a>]</p>';
            break;
    }
}
$text .= '</div>';
/* spacer */
コード例 #11
0
ファイル: users.php プロジェクト: edblighter/collate-network
<?php

/**
 * Please see /include/common.php for documentation on common.php, the $COLLATE global array used by this program, and the AccessControl function used widely.
 */
require_once './include/common.php';
$op = empty($_GET['op']) ? 'default' : $_GET['op'];
switch ($op) {
    case "add":
        user_form();
        break;
    case "submit":
        submit_user();
        break;
    case "edit":
        user_form();
        break;
    default:
        AccessControl("1", null);
        list_users();
        break;
}
require_once './include/footer.php';
function list_users()
{
    global $COLLATE;
    global $dbo;
    require_once './include/header.php';
    $sql = "SELECT username, phone, email, last_login_at FROM users ORDER BY username";
    $result = $dbo->query($sql);
    echo "<h1>" . $COLLATE['languages']['selected']['Users'] . "</h1>\n" . "<p style=\"text-align: right;\"><a href=\"users.php?op=add\">" . "<img src=\"images/add.gif\" alt=\"\" /> " . $COLLATE['languages']['selected']['AddaUser'] . " </a></p>";