Skip to content

Commit

Permalink
Merge pull request #144 from strangerstudios/dev
Browse files Browse the repository at this point in the history
Updating master branch to latest.
  • Loading branch information
andrewlimaza authored Apr 9, 2021
2 parents ae18fcd + 201df72 commit 985d4ec
Show file tree
Hide file tree
Showing 10 changed files with 805 additions and 61 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
approval-process-for-membership-add-on-banner.png export-ignore
README.md export-ignore
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
![](approval-process-for-membership-add-on-banner.png)

# [Approval Process for Membership](https://www.paidmembershipspro.com/add-ons/approval-process-membership/) #
[comment]: # (Generate badges from shields.io, only works for .org plugins to get other stats etc. We'd have to create our own endpoints for Premium plugins)

![License](https://img.shields.io/badge/license-GPL--2.0%2B-red.svg?style=flat-square)

### Welcome to the Approval Process for Membership GitHub Repository
Grant membership site administrators the ability to approve or deny members. The Approvals Add On for Paid Memberships Pro allows you to set up a unique approval or application process for your membership site.

For more information please visit [https://www.paidmembershipspro.com/add-ons/approval-process-membership/](https://www.paidmembershipspro.com/add-ons/approval-process-membership/)

## Installation ##
For detailed installation steps, visit the [documentation](https://www.paidmembershipspro.com/add-ons/approval-process-membership/) page.

1. Download the current development ZIP file directly: `https://github.com/strangerstudios/pmpro-approvals/archive/dev.zip`

**Please ensure that once installing this version of the plugin to remove `-dev` from the plugin's folder name.**

## Bugs ##
If you find an issue/bug, let us know by [creating a detailed GitHub issue](https://github.com/strangerstudios/pmpro-approvals/issues/new).

## Support ##
This is a developer's portal for Approval Process for Membership. We do not offer support on this channel. **Any support related questions should be directed to [https://www.paidmembershipspro.com/add-ons/approval-process-membership/](https://www.paidmembershipspro.com/add-ons/approval-process-membership/).**

## Contributing to Approval Process for Membership ##
We encourage and welcome any contribution to Approval Process for Membership. Please read the [guidelines for contributing](https://github.com/strangerstudios/pmpro-approvals/blob/dev/.github/CONTRIBUTING.md) to this repository.

There are various **ways to the help development** of Approval Process for Membership:

1. Report [bugs/issues](https://github.com/strangerstudios/pmpro-approvals/issues/new) on GitHub.
2. Work on any issues by submitting a Pull Request.

Here are some ways for **non-developers to contribute** to Approval Process for Membership:

1. Translate Approval Process for Membership into your own [language](https://www.paidmembershipspro.com/paid-memberships-pro-in-your-language/).
2. [Purchase a plus membership](https://paidmembershipspro.com/pricing) to help fund ongoing development and bug fixes.
10 changes: 7 additions & 3 deletions adminpages/approvals.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@
//Approve, deny or reset member back to pending
if ( ! empty( $_REQUEST['approve'] ) ) {
check_admin_referer( 'pmpro_approvals', 'pmpro_approvals_nonce' );
PMPro_Approvals::approveMember( intval( $_REQUEST['approve'] ), $l );
if ( ! PMPro_Approvals::isApproved( intval( $_REQUEST['approve'] ) ) ) {
PMPro_Approvals::approveMember( intval( $_REQUEST['approve'] ), $l );
}
} elseif ( ! empty( $_REQUEST['deny'] ) ) {
check_admin_referer( 'pmpro_approvals', 'pmpro_approvals_nonce' );
PMPro_Approvals::denyMember( intval( $_REQUEST['deny'] ), $l );
if ( ! PMPro_Approvals::isDenied( intval( $_REQUEST['deny'] ) ) ) {
PMPro_Approvals::denyMember( intval( $_REQUEST['deny'] ), $l );
}
} elseif ( ! empty( $_REQUEST['unapprove'] ) ) {
check_admin_referer( 'pmpro_approvals', 'pmpro_approvals_nonce' );
PMPro_Approvals::resetMember( intval( $_REQUEST['unapprove'] ), $l );
Expand Down Expand Up @@ -205,7 +209,7 @@ class="alternate"<?php } ?>>
</td>
<td><?php echo trim( $theuser->first_name . ' ' . $theuser->last_name ); ?></td>
<td><a href="mailto:<?php echo $theuser->user_email; ?>"><?php echo $theuser->user_email; ?></a></td>
<?php do_action( 'pmpro_approvals_list_extra_cols_body', $theusers ); ?>
<?php do_action( 'pmpro_approvals_list_extra_cols_body', $theuser ); ?>
<td>
<?php
echo $auser->membership;
Expand Down
30 changes: 22 additions & 8 deletions adminpages/userinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@

<form id="posts-filter" method="get" action="">
<h2>
<?php echo $user->ID; ?> - <?php echo esc_attr( $user->display_name ); ?> (<?php echo esc_attr( $user->user_login ); ?>)
<a href="<?php echo admin_url( 'user-edit.php?user_id=' . $user->ID ); ?>" class="button button-primary">Edit Profile</a>
<?php echo intval( $user->ID ); ?> - <?php echo esc_html( $user->display_name ); ?> (<?php echo esc_html( $user->user_login ); ?>)
<a href="<?php echo admin_url( 'user-edit.php?user_id=' . intval( $user->ID ) ); ?>" class="button button-primary"><?php esc_html_e( 'Edit Profile', 'pmpro-approvals' ); ?></a>
</h2>

<h3><?php _e( 'Account Information', 'pmpro-approvals' ); ?></h3>
<h3><?php esc_html_e( 'Account Information', 'pmpro-approvals' ); ?></h3>
<table class="form-table">
<tr>
<th><label><?php _e( 'User ID', 'pmpro-approvals' ); ?></label></th>
<td><?php echo $user->ID; ?></td>
<th><label><?php esc_html_e( 'User ID', 'pmpro-approvals' ); ?></label></th>
<td><?php echo intval( $user->ID ); ?></td>
</tr>
<tr>
<th><label><?php _e( 'Username', 'pmpro-approvals' ); ?></label></th>
Expand All @@ -55,7 +55,7 @@
<td><?php echo sanitize_email( $user->user_email ); ?></td>
</tr>
<tr>
<th><label><?php _e( 'Membership Level', 'pmpro-approvals' ); ?></label></th>
<th><label><?php esc_html_e( 'Membership Level', 'pmpro-approvals' ); ?></label></th>
<td>
<?php
//Changed this to show Membership Level Name now, so approvers don't need to go back and forth to see what level the user is applying for.
Expand Down Expand Up @@ -101,14 +101,23 @@
foreach ( $pmprorh_registration_fields as $where => $fields ) {
$box = pmprorh_getCheckoutBoxByName( $where );
?>
<h3><?php echo esc_html( $box->label ); ?></h3>
<?php if ( isset( $box->label ) ) { ?>
<h3><?php echo esc_html( $box->label ); ?></h3>
<?php } ?>

<table class="form-table">
<?php
//cycle through groups

foreach ( $fields as $field ) {
// show field as long as it's not false
if ( false != $field->profile ) {

// Check to see if level is set for the field.
if ( isset( $field->levels ) && ! in_array( $level_details->ID, $field->levels ) ) {
break;
}

?>
<tr>
<th><label><?php echo esc_attr( $field->label ); ?></label></th>
Expand All @@ -133,7 +142,12 @@
// remove trailing comma from string.
echo '<td>' . esc_html( rtrim( $rh_field_string, ', ' ) ) . '</td>';
} else {
echo '<td>' . esc_html( $register_helper_fields ) . '</td>';
// If Register Helper field is a valid URL, then let's make it clickable.
if ( wp_http_validate_url( $register_helper_fields ) ) {
echo '<td><a href="' . esc_url_raw( $register_helper_fields ) . '" target="_blank">' . esc_url( $register_helper_fields ) . '</a></td>';
} else {
echo '<td>' . esc_html( $register_helper_fields ) . '</td>';
}
}

} ?>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions classes/class.approvalemails.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public function sendAdminPending( $member = null, $admin = null ) {
$this->body = file_get_contents( PMPRO_APP_DIR . '/email/admin_notification.html' );
$this->data = array(
'subject' => $this->subject,
'name' => $admin->display_name,
'user_login' => $admin->user_login,
'name' => isset( $admin->display_name ) ? $admin->display_name : "",
'user_login' => isset( $admin->user_login ) ? $admin->user_login : "",
'sitename' => get_option( 'blogname' ),
'siteemail' => pmpro_getOption( 'from_email' ),
'login_link' => wp_login_url(),
Expand Down
Binary file added languages/pmpro-approvals-de_DE_formal.mo
Binary file not shown.
Loading

0 comments on commit 985d4ec

Please sign in to comment.