-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated User Member Edit page with backend. (#112)
* show member page to currently logged in user * show member page to currently logged in user * semicolon * user object to string * things to make angualr behave * filepath fix * filepath fix * dev * semicolon * waiting on Angular to get out of the way * Fixing submit with Angular * Fixing submit with Angular * Fixing submit with Angular * Fixing submit with Angular * Fixing submit with Angular * Fixing submit with Angular * dev * Fixing submit with Angular * Fixing submit with Angular * removing material * make admin edit fields not required * more remove material edits * panel for payment info * more stuff * full removal of angular * add redirect back * more edits * Fixing submit * add redirect back * Fixing submit * add redirect back * Fixing submit
- Loading branch information
Showing
6 changed files
with
126 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
defined( 'ABSPATH' ) or die(); | ||
|
||
require_once dirname(__DIR__).'/front-end-pages/resources/GSuiteAPI.php'; | ||
|
||
// Adding the action to the wordpress hooks | ||
add_action('admin_post_update_self', 'prefix_user_update_self'); | ||
|
||
|
||
function prefix_user_update_self() { | ||
|
||
$username = wp_get_current_user()->user_email; | ||
|
||
$firstName = $_POST['firstName']; | ||
$lastName = $_POST['lastName']; | ||
$personalEmail = $_POST['personalEmail']; | ||
|
||
|
||
$properties = array( | ||
'name' => array( | ||
'givenName' => $firstName, | ||
'familyName' => $lastName | ||
), | ||
'emails' => array( | ||
array( | ||
'address' => $personalEmail | ||
) | ||
) | ||
); | ||
|
||
updateUser($username, $properties); | ||
|
||
wp_redirect('member'); | ||
exit("User updated succesfully"); | ||
} |