private function TryToConfirmEmail() { if (!rw_request_is_action('confirm', 'rw_action')) { return false; } // Remove confirmation notice. remove_action('all_admin_notices', array(&$this, 'ConfirmationNotice')); $user_id = rw_request_get('user_id'); $site_id = rw_request_get('site_id'); $email = rw_request_get('email'); $timestamp = rw_request_get('ts'); $secure = rw_request_get('s'); $is_valid = true; if ($secure !== md5(strtolower($user_id . $email . $timestamp . $this->account->site_public_key))) { $is_valid = false; } if (!is_numeric($user_id)) { $is_valid = false; } if (!is_numeric($timestamp)) { $is_valid = false; } if (time() > $timestamp + 14 * 86400) { $is_valid = false; } if (!$is_valid) { add_action('all_admin_notices', array(&$this, 'InvalidEmailConfirmNotice')); return true; } $this->SetOption(WP_RW__DB_OPTION_OWNER_ID, $user_id); $this->SetOption(WP_RW__DB_OPTION_OWNER_EMAIL, $email); $this->SetOption(WP_RW__DB_OPTION_SITE_ID, $site_id); $this->_options->store(); // $this->fs->update_account($user_id, $email, $site_id); add_action('all_admin_notices', array(&$this, 'SuccessfulEmailConfirmNotice')); return true; }
/** * Store account params in the Database. * * @author Vova Feldman (@svovaf) * @since 1.0.1 */ private function _store_account() { $this->_logger->entrance(); $this->_store_site(false); $this->_store_user(false); $this->_store_plans(false); $this->_store_licenses(false); self::$_accounts->store(); }
private function _store_account() { $this->_store_site(false); $this->_store_user(false); self::$_accounts->store(); }
/** * Migration from account options stored in FS accounts object back to RW options object. * * @author Vova Feldman (@svovaf) * @since 2.6.3 * * @param FS_Option_Manager $fs_options * @param string $basename */ private function migrate_from_fs_options($fs_options, $basename) { // Load site information. $sites = $fs_options->get_option('sites'); $site = $sites[$basename]; // Load user information. $users = $fs_options->get_option('users'); $user = $users[$site->user_id]; // Update account information. $this->set($site->id, $site->public_key, $site->secret_key, $user->id, $user->email); // Remove RW account from FS object. unset($sites[$basename]); unset($users[$site->user_id]); $fs_options->set_option('sites', $sites); $fs_options->set_option('users', $users); $fs_options->store(); }
function store() { $this->_options->store(); }