Skip to content

Commit

Permalink
added pdflib to plugin, added certificate class, added button to fron…
Browse files Browse the repository at this point in the history
…tend
  • Loading branch information
TobiKaestle committed Sep 14, 2017
1 parent 65f79e6 commit d35d07a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions includes/class-vca-asm-profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,22 @@ public function save_extra_profile_fields( $user_id )
{
global $vca_asm_geography, $vca_asm_mailer;

if ( ! current_user_can( 'edit_user', $user_id ) ) {
return false;
}
if ( ! current_user_can( 'edit_user', $user_id ) ) {
return false;
}

$this_user = new WP_User( $user_id );

if ( isset($_POST['download-certificate'] )) {

require_once( VCA_ASM_ABSPATH . '/includes/class-vca-asm-certificate.php' );

$certificate = new VcA_ASM_Certificate();
$certificate->setUser($this_user);
echo $certificate->getCertificate();
//die();

}

if ( isset( $_POST['deleteme'] ) && $_POST['deleteme'] == 'forever' ) {
wp_delete_user( $user_id );
Expand All @@ -158,7 +171,6 @@ public function save_extra_profile_fields( $user_id )
break;

case 'membership':
$this_user = new WP_User( $user_id );
if( in_array( 'city', $this_user->roles ) ) {
update_user_meta( $user_id, $field['id'], '2' );
} else {
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

case 'select':
$output .= '<select name="' . $field['id'] .
'" id="' . $field['id'] . '"' .
'" id="' . $field['id'] . '"';
if( isset( $field['disabled'] ) && $field['disabled'] === true ) {
$output .= ' disabled="disabled"';
}
Expand Down

0 comments on commit d35d07a

Please sign in to comment.