Plugin Directory

Changeset 2047716


Ignore:
Timestamp:
03/10/2019 07:10:54 PM (7 years ago)
Author:
ider
Message:

Ready for 1.6.1

Location:
ider-login/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ider-login/trunk/includes/IDER_Admin.php

    r1679807 r2047716  
    139139                    </tr>
    140140
     141                    <tr valign="top">
     142
     143                        <th scope="row">Allow Login only to Administrator Users</th>
     144                        <td>
     145                            <input type="checkbox" name="<?php echo $this->option_name ?>[ider_admin_mode]"
     146                                   value="1" <?php echo $options['ider_admin_mode'] == 1 ? 'checked="checked"' : ''; ?> />
     147                        </td>
     148                    </tr>
     149
    141150                </table>
    142151
  • ider-login/trunk/includes/IDER_Callback.php

    r1960496 r2047716  
    4545            // TODO: leverage future endpoint to check which side changed the email: local->no access and error msg, remote->update email
    4646        }
     47
     48        // Store the user roles to check for admins later
     49        $user_roles = array();
     50
     51        if($user->roles) {
     52            $user_roles = $user->roles;
     53        }
     54
     55        if((IDER_Server::get_option('ider_admin_mode') == 1) && !in_array('administrator', $user_roles)) {
     56            IDER_Callback::access_denied("Only administrator can log-in via IDer.");
     57        }
     58        // --
    4759
    4860        // if new, register first
     
    104116    private static function _update_usermeta($user_id, $userdata)
    105117    {
     118
     119        if(!$user_id && !$userdata) {
     120            return;
     121        }
     122
    106123        $updated = [];
    107124
  • ider-login/trunk/includes/IDER_Server.php

    r1960496 r2047716  
    2424        'extra_scopes' => '',
    2525        'login_form_button' => true,
     26        'ider_admin_mode' => false,
    2627        'welcome_page' => 'my-account/ider-profile',
    2728        'button_css' => '',
     
    9495    public static function getIDerOpenIdClientIstance()
    9596    {
    96         \IDERConnect\IDEROpenIDClient::$IDERLogFile = IDER_PLUGIN_DIR . '/log/ider-connect.log';
     97
     98        // Log file placed into uploads folder.
     99        $wpUploads = wp_upload_dir();
     100
     101        $filename =  $wpUploads['basedir'] . '/ider-logs/log/ider-connect.log';
     102
     103        if (!file_exists(dirname($filename))) {
     104            mkdir(dirname($filename), 0777, true);
     105        }
     106
     107        \IDERConnect\IDEROpenIDClient::$IDERLogFile = $filename;
    97108
    98109        // Override the base URL with the WP one.
  • ider-login/trunk/readme.md

    r1960529 r2047716  
    33Requires at least: 4.6
    44Tested up to: 4.9.8
    5 Stable tag: 1.6.0
     5Stable tag: 1.6.1
    66License: Apache License, Version 2.0 or later
    77License URI: http://directory.fsf.org/wiki/License:Apache2.0
     
    7171* Updated OID Client
    7272* Fixed wrong CSS path
     73
     74= 1.6.1 =
     75* Added flag "Allow Login only to Administrator Users"
     76* Update ider-log path.
  • ider-login/trunk/wp-ider-login-client.php

    r1960496 r2047716  
    33 * Plugin Name: IDer Login
    44 * Plugin URI: https://www.ider.com
    5  * Version: 1.6.0
     5 * Version: 1.6.1
    66 * Description: Provides Single Sign On via IDer Identity Server
    77 * Author: JLM srl
     
    3434
    3535if (!defined('IDER_CLIENT_VERSION')) {
    36     define('IDER_CLIENT_VERSION', '1.6.0');
     36    define('IDER_CLIENT_VERSION', '1.6.1');
    3737}
    3838
Note: See TracChangeset for help on using the changeset viewer.