当前位置: 首页>>代码示例>>PHP>>正文


PHP get_user_to_edit函数代码示例

本文整理汇总了PHP中get_user_to_edit函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_to_edit函数的具体用法?PHP get_user_to_edit怎么用?PHP get_user_to_edit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_user_to_edit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_profile_user_role

function get_profile_user_role()
{
    global $wp_roles, $user_id;
    $user_id = (int) $user_id;
    $current_user = wp_get_current_user();
    $profileuser = get_user_to_edit($user_id);
    if ($user_id != $current_user->ID) {
        $roles = $profileuser->roles;
        $role = array_shift($roles);
        return $role;
    }
    return;
}
开发者ID:rzb,项目名称:boletos2,代码行数:13,代码来源:global-admin-bar-hide-or-remove.php

示例2: __

    $disabled_field = ' disabled="disabled"';
    $pass_title = __('New Pass:', 'wphone');
    if ($this->current_basename == 'profile.php' || !current_user_can('edit_users')) {
        // @note PROFILE FORM
        global $userdata;
        $subcontext = 'profile';
        $edit_user = get_user_to_edit($user_ID);
        $form_title = __('Your Profile');
        $nonceid = 'update-profile_' . $edit_user->ID;
        $formaction = 'profile-update.php';
    } else {
        // // @note USER EDIT FORM
        $this->check_user_permissions('edit_users');
        $subcontext = 'edit';
        $edit_id = (int) $_GET['user_id'];
        $edit_user = $edit_id ? get_user_to_edit($edit_id) : null;
        $form_title = __('Edit User');
        $nonceid = 'update-user_' . $edit_user->ID;
        $formaction = 'user-edit.php';
    }
} else {
    // @note ADD FORM, LIKE WP AFTER USER LIST
    $this->check_user_permissions('edit_users');
    $this->context = 'list';
    $subcontext = 'add';
    $form_title = __('Add New User');
    $pass_title = __('Password:', 'wphone');
    $nonceid = 'add-user';
    $formaction = 'users.php';
    if (is_wp_error($add_user_errors)) {
        $selected_form = ' selected="true"';
开发者ID:SymbiSoft,项目名称:litprojects,代码行数:31,代码来源:user-form.php

示例3: edit_user

        // Update the user.
        $errors = edit_user($user_id);
        // Grant or revoke super admin status if requested.
        if (is_multisite() && is_network_admin() && !IS_PROFILE_PAGE && current_user_can('manage_network_options') && !isset($super_admins) && empty($_POST['super_admin']) == is_super_admin($user_id)) {
            empty($_POST['super_admin']) ? revoke_super_admin($user_id) : grant_super_admin($user_id);
        }
        if (!is_wp_error($errors)) {
            $redirect = add_query_arg('updated', true, get_edit_user_link($user_id));
            if ($wp_http_referer) {
                $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect);
            }
            wp_redirect($redirect);
            exit;
        }
    default:
        $profileuser = get_user_to_edit($user_id);
        if (!current_user_can('edit_user', $user_id)) {
            wp_die(__('You do not have permission to edit this user.'));
        }
        $sessions = WP_Session_Tokens::get_instance($profileuser->ID);
        include ABSPATH . 'wp-admin/admin-header.php';
        ?>

<?php 
        if (!IS_PROFILE_PAGE && is_super_admin($profileuser->ID) && current_user_can('manage_network_options')) {
            ?>
	<div class="updated"><p><strong><?php 
            _e('Important:');
            ?>
</strong> <?php 
            _e('This user has super admin privileges.');
开发者ID:harissonsofia,项目名称:WordPress,代码行数:31,代码来源:user-edit.php

示例4: ure_removeCapability

function ure_removeCapability()
{
    global $wpdb, $wp_roles;
    $mess = '';
    if (isset($_GET['removeusercapability']) && $_GET['removeusercapability']) {
        $capability = $_GET['removeusercapability'];
        $capsToRemove = ure_getCapsToRemove();
        if (!is_array($capsToRemove) || count($capsToRemove) == 0 || !isset($capsToRemove[$capability])) {
            return sprintf(__('Error! You do not have permission to delete this capability: %s!', 'ure'), $capability);
        }
        // process users
        $usersId = $wpdb->get_col($wpdb->prepare("SELECT {$wpdb->users}.ID FROM {$wpdb->users}"));
        foreach ($usersId as $user_id) {
            $user = get_user_to_edit($user_id);
            if (isset($user->roles[0]) && $user->roles[0] == 'administrator') {
                continue;
            }
            if ($user->has_cap($capability)) {
                $user->remove_cap($capability);
            }
        }
        // process roles
        foreach ($wp_roles->role_objects as $wp_role) {
            if ($wp_role->has_cap($capability)) {
                $wp_role->remove_cap($capability);
            }
        }
        $mess = sprintf(__('Capability %s is removed successfully', 'ure'), $capability);
    }
    return $mess;
}
开发者ID:kitfrench,项目名称:Futurestep,代码行数:31,代码来源:ure-lib.php

示例5: cimy_delete_user_info

function cimy_delete_user_info($user_id)
{
    global $wpdb, $wpdb_data_table, $cuef_upload_path;
    if (!current_user_can('edit_user', $user_id)) {
        return;
    }
    $sql = "DELETE FROM " . $wpdb_data_table . " WHERE USER_ID=" . $user_id;
    $wpdb->query($sql);
    $profileuser = get_user_to_edit($user_id);
    $user_login = $profileuser->user_login;
    $file_path = $cuef_upload_path . $user_login . "/";
    // delete all uploaded files for that users
    cimy_rfr($file_path, "*");
    // delete also the subdir
    if (is_dir($file_path)) {
        rmdir($file_path);
    }
}
开发者ID:jayfresh,项目名称:SweetSpot,代码行数:18,代码来源:cimy_uef_db.php

示例6: show_account_page

 function show_account_page($content = null)
 {
     global $bp, $profileuser, $user, $user_id;
     if (!is_user_logged_in()) {
         return apply_filters('membership_account_form_not_logged_in', $content);
     }
     require_once ABSPATH . 'wp-admin/includes/user.php';
     $user = wp_get_current_user();
     $user_id = $user->ID;
     $profileuser = get_user_to_edit($user_id);
     $content = '';
     $content = apply_filters('membership_account_form_before_content', $content);
     ob_start();
     if (defined('MEMBERSHIP_ACCOUNT_FORM') && file_exists(MEMBERSHIP_ACCOUNT_FORM)) {
         include_once MEMBERSHIP_ACCOUNT_FORM;
     } elseif (!empty($bp) && file_exists(apply_filters('membership_override_bpaccount_form', membership_dir('membershipincludes/includes/bp.account.form.php'), $user_id))) {
         include_once apply_filters('membership_override_bpaccount_form', membership_dir('membershipincludes/includes/bp.account.form.php'), $user_id);
     } elseif (file_exists(apply_filters('membership_override_account_form', membership_dir('membershipincludes/includes/account.form.php'), $user_id))) {
         include_once apply_filters('membership_override_account_form', membership_dir('membershipincludes/includes/account.form.php'), $user_id);
     }
     $content .= ob_get_contents();
     ob_end_clean();
     $content = apply_filters('membership_account_form_after_content', $content, $user_id);
     return $content;
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:25,代码来源:membershippublic.php

示例7: multiple_roles_field

 public static function multiple_roles_field($user)
 {
     global $pagenow, $user_id;
     if (in_array($pagenow, array('user-edit.php', 'user-new.php'))) {
         $editable_roles = get_editable_roles();
         if ($user_id) {
             $user = get_user_to_edit($user_id);
             $user_roles = array_intersect(array_values($user->roles), array_keys($editable_roles));
         } else {
             $user_roles = null;
         }
         $roles = array();
         foreach ($editable_roles as $role => $details) {
             $roles[$role] = translate_user_role($details['name']);
         }
         piklist::render('shared/field-user-role', array('user_roles' => $user_roles, 'roles' => $roles), false);
     }
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:18,代码来源:class-piklist-user.php

示例8: cimy_update_ExtraFields_new_me

function cimy_update_ExtraFields_new_me()
{
    global $wpdb, $wpdb_data_table, $user_ID, $max_length_value, $fields_name_prefix, $cimy_uef_file_types, $user_level, $cimy_uef_domain;
    include_once ABSPATH . '/wp-admin/includes/user.php';
    // if updating meta-data from registration post then exit
    if (isset($_POST['cimy_post'])) {
        return;
    }
    if (isset($_POST['user_id'])) {
        $get_user_id = $_POST['user_id'];
        if (!current_user_can('edit_user', $get_user_id)) {
            return;
        }
    } else {
        return;
    }
    //echo "asd";
    if (!function_exists('get_cimyFields')) {
        return;
    }
    $get_user_id = intval($get_user_id);
    $profileuser = get_user_to_edit($get_user_id);
    $user_login = $profileuser->user_login;
    $user_displayname = $profileuser->display_name;
    $extra_fields = get_cimyFields(false, true);
    $query = "UPDATE " . $wpdb_data_table . " SET VALUE=CASE FIELD_ID";
    $i = 0;
    $field_ids = "";
    $mail_changes = "";
    foreach ($extra_fields as $thisField) {
        $field_id = $thisField["ID"];
        $name = $thisField["NAME"];
        $type = $thisField["TYPE"];
        $label = $thisField["LABEL"];
        $rules = $thisField["RULES"];
        $unique_id = $fields_name_prefix . $field_id;
        $input_name = $fields_name_prefix . esc_attr($name);
        $field_id_data = $input_name . "_" . $field_id . "_data";
        $advanced_options = cimy_uef_parse_advanced_options($rules["advanced_options"]);
        cimy_insert_ExtraFields_if_not_exist($get_user_id, $field_id);
        // if the current user LOGGED IN has not enough permissions to see the field, skip it
        // apply only for EXTRA FIELDS
        if ($rules['show_level'] == 'view_cimy_extra_fields') {
            if (!current_user_can($rules['show_level'])) {
                continue;
            }
        } else {
            if ($user_level < $rules['show_level']) {
                continue;
            }
        }
        // if show_level == anonymous then do NOT ovverride other show_xyz rules
        if ($rules['show_level'] == -1) {
            // if flag to show the field in the profile is NOT activated, skip it
            if (!$rules['show_in_profile']) {
                continue;
            }
        }
        $prev_value = $wpdb->escape(stripslashes($_POST[$input_name . "_" . $field_id . "_prev_value"]));
        if (cimy_uef_is_field_disabled($type, $rules['edit'], $prev_value)) {
            continue;
        }
        if (isset($_POST[$input_name]) && !in_array($type, $cimy_uef_file_types)) {
            if ($type == "dropdown-multi") {
                $field_value = stripslashes(implode(",", $_POST[$input_name]));
            } else {
                $field_value = stripslashes($_POST[$input_name]);
            }
            if ($type == "picture-url") {
                $field_value = str_replace('../', '', $field_value);
            }
            if (isset($rules['max_length'])) {
                $field_value = substr($field_value, 0, $rules['max_length']);
            } else {
                $field_value = substr($field_value, 0, $max_length_value);
            }
            $field_value = $wpdb->escape($field_value);
            if ($i > 0) {
                $field_ids .= ", ";
            } else {
                $i = 1;
            }
            $field_ids .= $field_id;
            $query .= " WHEN " . $field_id . " THEN ";
            switch ($type) {
                case 'dropdown':
                case 'dropdown-multi':
                    $ret = cimy_dropDownOptions($label, $field_value);
                    $label = $ret['label'];
                case 'picture-url':
                case 'textarea':
                case 'textarea-rich':
                case 'password':
                case 'text':
                    $value = "'" . $field_value . "'";
                    $prev_value = "'" . $prev_value . "'";
                    break;
                case 'checkbox':
                    $value = $field_value == '1' ? "'YES'" : "'NO'";
                    $prev_value = $prev_value == "YES" ? "'YES'" : "'NO'";
//.........这里部分代码省略.........
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:101,代码来源:functions.php

示例9: check_user_to_edit

 protected function check_user_to_edit()
 {
     if ($this->ure_object == 'user') {
         if (!isset($_REQUEST['user_id'])) {
             return false;
             // user_id value is missed
         }
         $user_id = $_REQUEST['user_id'];
         if (!is_numeric($user_id)) {
             return false;
         }
         if (!$user_id) {
             return false;
         }
         $this->user_to_edit = get_user_to_edit($user_id);
         if (empty($this->user_to_edit)) {
             return false;
         }
     }
     return true;
 }
开发者ID:developmentDM2,项目名称:What-The-Flicka,代码行数:21,代码来源:ure-lib.php

示例10: user_admin

        /**
         * Display the user's profile.
         *
         * @access public
         * @since BuddyPress (2.0.0)
         */
        public function user_admin()
        {
            if (!current_user_can('bp_moderate')) {
                die('-1');
            }
            $user = get_user_to_edit($_GET['user_id']);
            // Construct URL for form
            $form_url = remove_query_arg(array('action', 'error', 'updated', 'spam', 'ham'), $_SERVER['REQUEST_URI']);
            $form_url = esc_url(add_query_arg('action', 'update', $form_url));
            $wp_http_referer = remove_query_arg(array('action', 'updated'), $_REQUEST['wp_http_referer']);
            // Prepare notice for admin
            $notice = array();
            if (!empty($_REQUEST['updated'])) {
                switch ($_REQUEST['updated']) {
                    case 'avatar':
                        $notice = array('class' => 'updated', 'message' => __('Avatar was deleted successfully!', 'buddypress'));
                        break;
                    case 'ham':
                        $notice = array('class' => 'updated', 'message' => __('User removed as spammer.', 'buddypress'));
                        break;
                    case 'spam':
                        $notice = array('class' => 'updated', 'message' => __('User marked as spammer. Spam users are visible only to site admins.', 'buddypress'));
                        break;
                    case 1:
                        $notice = array('class' => 'updated', 'message' => __('Profile updated.', 'buddypress'));
                        break;
                }
            }
            if (!empty($_REQUEST['error'])) {
                switch ($_REQUEST['error']) {
                    case 'avatar':
                        $notice = array('class' => 'error', 'message' => __('There was a problem deleting that avatar, please try again.', 'buddypress'));
                        break;
                    case 'ham':
                        $notice = array('class' => 'error', 'message' => __('User could not be removed as spammer.', 'buddypress'));
                        break;
                    case 'spam':
                        $notice = array('class' => 'error', 'message' => __('User could not be marked as spammer.', 'buddypress'));
                        break;
                    case 1:
                        $notice = array('class' => 'error', 'message' => __('An error occured while trying to update the profile.', 'buddypress'));
                        break;
                    case 2:
                        $notice = array('class' => 'error', 'message' => __('Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress'));
                        break;
                    case 3:
                        $notice = array('class' => 'error', 'message' => __('There was a problem updating some of your profile information, please try again.', 'buddypress'));
                        break;
                }
            }
            if (!empty($notice)) {
                if ('updated' === $notice['class']) {
                    ?>
				<div id="message" class="<?php 
                    echo esc_attr($notice['class']);
                    ?>
">
			<?php 
                } else {
                    ?>
				<div class="<?php 
                    echo esc_attr($notice['class']);
                    ?>
">
			<?php 
                }
                ?>
				<p><?php 
                echo esc_html($notice['message']);
                ?>
</p>
				<?php 
                if (!empty($wp_http_referer) && 'updated' === $notice['class']) {
                    ?>
					<p><a href="<?php 
                    echo esc_url($wp_http_referer);
                    ?>
"><?php 
                    esc_html_e('&larr; Back to Users', 'buddypress');
                    ?>
</a></p>
				<?php 
                }
                ?>
			</div>
		<?php 
            }
            ?>

		<div class="wrap"  id="community-profile-page">
			<?php 
            screen_icon('users');
            ?>
			<h2>
//.........这里部分代码省略.........
开发者ID:danielcoats,项目名称:schoolpress,代码行数:101,代码来源:bp-members-admin.php

示例11: web_invoice_draw_user_selection_form

function web_invoice_draw_user_selection_form($user_id)
{
    global $wpdb, $blog_id;
    $_SESSION['last_new_invoice'] = true;
    ?>

<div class="postbox" id="wp_new_web_invoice_div">
<div class="inside">
<form action="admin.php?page=new_web_invoice" method='POST'>
<table class="form-table" id="get_user_info">
	<tr class="">
		<th><?php 
    if (isset($user_id)) {
        _e("Start New Invoice For: ", WEB_INVOICE_TRANS_DOMAIN);
    } else {
        _e("Create New Invoice For: ", WEB_INVOICE_TRANS_DOMAIN);
    }
    ?>
</th>
		<td><select name='user_id' class='user_selection'>
			<option></option>
			<?php 
    if (is_dir(WP_CONTENT_DIR . '/mu-plugins') || MULTISITE) {
        $prefix = $wpdb->base_prefix;
        if ($prefix == "") {
            $prefix = $wpdb->prefix;
        }
        $get_all_users = $wpdb->get_results("SELECT * FROM {$prefix}users LEFT JOIN {$prefix}usermeta on {$prefix}users.id={$prefix}usermeta.user_id WHERE ({$prefix}usermeta.meta_key='primary_blog' and {$prefix}usermeta.meta_value = {$blog_id}) OR ({$prefix}usermeta.meta_key='{$wpdb->prefix}capabilities') ORDER BY {$prefix}users.user_nicename");
    } else {
        $prefix = $wpdb->prefix;
        $get_all_users = $wpdb->get_results("SELECT ID FROM {$prefix}users ORDER BY {$prefix}users.user_nicename");
    }
    $_used_ids = array();
    foreach ($get_all_users as $user) {
        if (isset($_used_ids[$user->ID])) {
            continue;
        }
        $profileuser = get_user_to_edit($user->ID);
        echo "<option ";
        if (isset($user_id) && $user_id == $user->ID) {
            echo " SELECTED ";
        }
        if (!empty($profileuser->last_name) && !empty($profileuser->first_name)) {
            echo " value=\"" . $user->ID . "\">" . $profileuser->last_name . ", " . $profileuser->first_name . " (" . $profileuser->user_email . ")</option>\n";
        } else {
            echo " value=\"" . $user->ID . "\">" . $profileuser->user_login . " (" . $profileuser->user_email . ")</option>\n";
        }
        $_used_ids[$user->ID] = true;
    }
    ?>
		</select> <input type='submit' class='button'
			id="web_invoice_create_new_web_invoice"
			value='<?php 
    _e("Create New Invoice", WEB_INVOICE_TRANS_DOMAIN);
    ?>
' />


			<?php 
    if (web_invoice_number_of_invoices() > 0) {
        ?>
<span
			id="web_invoice_copy_invoice" class="web_invoice_click_me"><?php 
        _e("copy from another", WEB_INVOICE_TRANS_DOMAIN);
        ?>
</span>
		<br />


		<div class="web_invoice_copy_invoice"><?php 
        $all_invoices = $wpdb->get_results("SELECT * FROM " . Web_Invoice::tablename('main'));
        ?>
		<select name="copy_from_template">
			<option SELECTED value=""></option>
			<?php 
        foreach ($all_invoices as $invoice) {
            $profileuser = get_user_to_edit($invoice->user_id);
            ?>
			<option value="<?php 
            echo $invoice->invoice_num;
            ?>
"><?php 
            if (web_invoice_recurring($invoice->invoice_num)) {
                _e("(recurring)", WEB_INVOICE_TRANS_DOMAIN);
            }
            ?>
			<?php 
            echo $invoice->subject . " - \$" . $invoice->amount;
            ?>
</option>

			<?php 
        }
        ?>

		</select><input type='submit' class='button'
			value='<?php 
        _e("New Invoice from Template", WEB_INVOICE_TRANS_DOMAIN);
        ?>
' />
//.........这里部分代码省略.........
开发者ID:dimps123,项目名称:web-invoice,代码行数:101,代码来源:Display.php

示例12: wpuf_user_edit_profile_form

/**
 * Shows the user profile form
 *
 * @global type $userdata
 * @param type $user_id
 */
function wpuf_user_edit_profile_form($user_id = null)
{
    global $userdata, $wp_http_referer;
    get_currentuserinfo();
    if (!function_exists('get_user_to_edit')) {
        require_once ABSPATH . '/wp-admin/includes/user.php';
    }
    if (!function_exists('_wp_get_user_contactmethods')) {
        require_once ABSPATH . '/wp-includes/registration.php';
    }
    if (!$user_id) {
        $current_user = wp_get_current_user();
        $user_id = $user_ID = $current_user->ID;
    }
    if (isset($_POST['submit'])) {
        check_admin_referer('update-profile_' . $user_id);
        $errors = edit_user($user_id);
        if (is_wp_error($errors)) {
            $message = $errors->get_error_message();
            $style = 'error';
        } else {
            $message = __('<strong>Success</strong>: Profile updated', 'wpuf');
            $style = 'success';
            do_action('personal_options_update', $user_id);
        }
    }
    $profileuser = get_user_to_edit($user_id);
    if (isset($message)) {
        echo '<div class="' . $style . '">' . $message . '</div>';
    }
    ?>
    <div class="wpuf-profile">
        <form name="profile" id="your-profile" action="" method="post">
            <?php 
    wp_nonce_field('update-profile_' . $user_id);
    ?>
            <?php 
    if ($wp_http_referer) {
        ?>
                <input type="hidden" name="wp_http_referer" value="<?php 
        echo esc_url($wp_http_referer);
        ?>
" />
            <?php 
    }
    ?>
            <input type="hidden" name="from" value="profile" />
            <input type="hidden" name="checkuser_id" value="<?php 
    echo $user_id;
    ?>
" />
            <table class="wpuf-table">
                <?php 
    do_action('personal_options', $profileuser);
    ?>
            </table>
            <?php 
    do_action('profile_personal_options', $profileuser);
    ?>

            <fieldset>
                <legend><?php 
    _e('Name');
    ?>
</legend>

                <table class="wpuf-table">
                    <tr>
                        <th><label for="user_login1"><?php 
    _e('Username');
    ?>
</label></th>
                        <td><input type="text" name="user_login" id="user_login1" value="<?php 
    echo esc_attr($profileuser->user_login);
    ?>
" disabled="disabled" class="regular-text" /><br /><em><span class="description"><?php 
    _e('Usernames cannot be changed.');
    ?>
</span></em></td>
                    </tr>
                    <tr>
                        <th><label for="first_name"><?php 
    _e('First Name');
    ?>
</label></th>
                        <td><input type="text" name="first_name" id="first_name" value="<?php 
    echo esc_attr($profileuser->first_name);
    ?>
" class="regular-text" /></td>
                    </tr>

                    <tr>
                        <th><label for="last_name"><?php 
    _e('Last Name');
//.........这里部分代码省略.........
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:101,代码来源:wpuf-editprofile.php

示例13: registerAction

 public function registerAction()
 {
     if (count($_POST)) {
         if ($_POST['agree_to_terms']) {
             global $wp_version;
             $partner = new Kaltura_Client_Type_Partner();
             $partner->name = $_POST['company'] ? $_POST['company'] : $_POST['first_name'] . ' ' . $_POST['last_name'];
             $partner->adminEmail = $_POST['email'];
             $partner->firstName = $_POST['first_name'];
             $partner->lastName = $_POST['last_name'];
             $partner->website = $_POST['website'];
             $partner->description = $_POST['description'] . "\nWordpress all-in-one plugin|" . $wp_version;
             $partner->country = strlen($_POST['country']) == 2 ? $_POST['country'] : null;
             $partner->state = strlen($_POST['state']) == 2 ? $_POST['state'] : null;
             $partner->commercialUse = Kaltura_Client_Enum_CommercialUseType::NON_COMMERCIAL_USE;
             $partner->phone = $_POST['phone'];
             $partner->type = Kaltura_Client_Enum_PartnerType::WORDPRESS;
             $partner->defConversionProfileType = 'wp_default';
             $partner->additionalParams = array();
             $keyValue = new Kaltura_Client_Type_KeyValue();
             $keyValue->key = 'company';
             $keyValue->value = $_POST['company'];
             $partner->additionalParams[] = $keyValue;
             $keyValue = new Kaltura_Client_Type_KeyValue();
             $keyValue->key = 'title';
             $keyValue->value = $_POST['job_title'];
             $partner->additionalParams[] = $keyValue;
             $keyValue = new Kaltura_Client_Type_KeyValue();
             $keyValue->key = 'would_you_like_to_be_contacted';
             $keyValue->value = $_POST['would_you_like'];
             $partner->additionalParams[] = $keyValue;
             $keyValue = new Kaltura_Client_Type_KeyValue();
             $keyValue->key = 'vertical';
             $keyValue->value = $_POST['describe_yourself'];
             $partner->additionalParams[] = $keyValue;
             $kmodel = KalturaModel::getInstance();
             $error = null;
             try {
                 $partner = $kmodel->registerPartner($partner);
             } catch (\Exception $ex) {
                 $error = $ex;
             }
             if ($error) {
                 $params['error'] = $error->getMessage();
             } else {
                 $partnerId = $partner->id;
                 $subPartnerId = $partnerId * 100;
                 $secret = $partner->secret;
                 $adminSecret = $partner->adminSecret;
                 $cmsUser = $partner->adminEmail;
                 // save partner details
                 update_option('kaltura_partner_id', $partnerId);
                 update_option('kaltura_subp_id', $subPartnerId);
                 update_option('kaltura_secret', $secret);
                 update_option('kaltura_admin_secret', $adminSecret);
                 update_option('kaltura_cms_user', $cmsUser);
                 $params['success'] = true;
             }
         } else {
             $params['error'] = 'You must agree to the Kaltura Terms of Use';
         }
         $params['pingOk'] = true;
     } else {
         global $user_ID;
         $profileuser = get_user_to_edit($user_ID);
         // set defaults
         $_POST['first_name'] = $profileuser->first_name;
         $_POST['last_name'] = $profileuser->last_name;
         $_POST['email'] = $profileuser->user_email;
         $_POST['company'] = get_bloginfo('name');
         $_POST['website'] = get_option('home');
         $config = KalturaHelpers::getKalturaConfiguration();
         $config->partnerId = 0;
         // no need to pass partner id for ping
         $config->subPartnerId = 0;
         $kalturaClient = new Kaltura_Client_Client($config);
         $kmodel = KalturaModel::getInstance();
         $params['pingOk'] = $kmodel->pingTest($kalturaClient);
     }
     $params['countries'] = KalturaHelpers::getCountries();
     $params['states'] = KalturaHelpers::getStates();
     $this->renderView('admin/register.php', $params);
 }
开发者ID:madHorse54,项目名称:all-in-one-video-pack.wordpress,代码行数:83,代码来源:AdminController.php

示例14: cyc_profile_init

function cyc_profile_init()
{
    function cyc_profile_js()
    {
        ?>
	<script type="text/javascript">
		function update_nickname() {

			var nickname = jQuery('#nickname').val();
			var display_nickname = jQuery('#display_nickname').val();

			if (nickname == '') {
				jQuery('#display_nickname').remove();
			}
			jQuery('#display_nickname').val(nickname).html(nickname);

		}

		jQuery(function ($) {
			//$('#pass1').keyup( check_pass_strength )
			$('.color-palette').click(function () {
				$(this).siblings('input[name=admin_color]').attr('checked', 'checked')
			});
		});

		jQuery(document).ready(function () {
			jQuery('#pass1,#pass2').attr('autocomplete', 'off');
			jQuery('#nickname').blur(update_nickname);
		});
	</script>
	<?php 
    }
    function cyc_profile_css()
    {
        ?>
	<style type="text/css">
		table.form-table th, table.form-table td
		{
			padding: 0;
		}

		table.form-table th
		{
			width: 150px;
			vertical-align: text-top;
			text-align: left;
		}

		p.message
		{
			padding: 3px 5px;
			background-color: lightyellow;
			border: 1px solid yellow;
		}

		#display_name
		{
			width: 250px;
		}

		.field-hint
		{
			display: block;
			clear: both;
		}
	</style>
	<?php 
    }
    if (!$user_id) {
        $current_user = wp_get_current_user();
        $user_id = $current_user->ID;
    }
    // If current user can see more of the admin area then just his profile, doing all this makes no sense.
    if ($current_user->has_cap('edit_posts') === false && $current_user->has_cap('subscription_agency') === false) {
        $is_profile_page = true;
        add_filter('wp_title', 'cyc_title');
        add_action('wp_head', 'cyc_profile_js');
        add_action('wp_head', 'cyc_profile_css');
        wp_enqueue_script('jquery');
        wp_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer'));
        $user_id = (int) $user_id;
        $profileuser = get_user_to_edit($user_id);
        if (!current_user_can('edit_user', $user_id)) {
            wp_die(__('You do not have permission to edit this user.'));
        }
        cyc_head(__('Личный кабинет пользователя'));
        if ($_GET['updated'] == true) {
            echo '<p class="message">Ваш профиль обновлён</p>';
        }
        get_template_part('_user', 'profile');
        cyc_footer();
        die;
    }
}
开发者ID:slavic18,项目名称:cats,代码行数:94,代码来源:usercustom.php

示例15: __

<?php

require_once 'admin.php';
$title = __('Profile');
if (current_user_can('edit_users')) {
    $parent_file = 'users.php';
} else {
    $parent_file = 'profile.php';
}
include_once 'admin-header.php';
$profileuser = get_user_to_edit($user_ID);
$bookmarklet_height = 440;
?>

<?php 
if (isset($_GET['updated'])) {
    ?>
<div id="message" class="updated fade">
<p><strong><?php 
    _e('Profile updated.');
    ?>
</strong></p>
</div>
<?php 
}
?>

<div class="wrap">
<h2><?php 
_e('Your Profile and Personal Options');
?>
开发者ID:helmonaut,项目名称:owb-mirror,代码行数:31,代码来源:profile.php


注:本文中的get_user_to_edit函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。