Plugin Directory

Changeset 998806


Ignore:
Timestamp:
09/29/2014 10:07:07 PM (12 years ago)
Author:
koter84
Message:

auto-commit

Location:
wpsol/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wpsol/trunk/common.php

    r854934 r998806  
    2424    );
    2525    $args = wp_parse_args( $args, $defaults );
    26    
     26
    2727    if( !$args['sidebar'] )
    2828        $echo = '<hr id="openid_split" style="clear: both; margin-bottom: 1.0em; border: 0; border-top: 1px solid #999; height: 1px;" />';
     
    3333        background-image: url(\'' . plugins_url( 'scnllogo.png', __FILE__ ) .  '\');
    3434        background-position: 3px 50%;
    35         background-repeat: no-repeat; 
    36         padding-left: 21px !important; 
     35        background-repeat: no-repeat;
     36        padding-left: 21px !important;
    3737    }
    3838    </style>
     
    9595                    header('Location: ' . $openid->authUrl());
    9696                }
    97             } 
     97            }
    9898        }
    9999        catch( ErrorException $e )
     
    144144            { // uhm.
    145145                // ToDo - notificatie naar site-admin o.i.d.
    146                 // mogelijke fouten: 
     146                // mogelijke fouten:
    147147                //  - user_id != email_id ( wat te doen )
    148148                //  - ???
     
    177177                update_user_meta( $user->ID, 'first_name', substr($gegevens['namePerson'], 0, strpos($gegevens['namePerson'], " ") ) );
    178178                update_user_meta( $user->ID, 'last_name', substr($gegevens['namePerson'], strpos($gegevens['namePerson'], " ")+1 ) );
    179             }           
     179            }
     180
     181            // add login filter to redirect
     182            add_filter( 'login_redirect', 'wpsol_login_redirect' );
    180183
    181184            return $user;
     
    193196    update_option('wpsol_username_prefix', 'sn_');
    194197    update_option('wpsol_autocreate', true);
     198    update_option('wpsol_login_redirect', 'default');
     199    update_option('wpsol_logout_redirect', 'default');
     200}
     201
     202// Redirect after login
     203function wpsol_login_redirect()
     204{
     205    if( get_option('wpsol_login_redirect') == "frontpage" )
     206    {
     207        return "/";
     208    }
     209    elseif( get_option('wpsol_login_redirect') == "dashboard" )
     210    {
     211        return "/wp-admin/";
     212    }
     213}
     214
     215// Redirect after logout
     216function wpsol_logout_redirect()
     217{
     218    if( get_option('wpsol_logout_redirect') == "frontpage" )
     219    {
     220        wp_redirect( home_url() );
     221        exit;
     222    }
    195223}
    196224
     
    203231    }
    204232
    205     // variables for the field and option names
     233    // variables for the field and option names
    206234    $options = array(
    207235        'wpsol_display_name' => array(
     
    209237            'type' => 'select',
    210238            'options' => array(
    211                 'fullname' => __('Full name', 'wpsol'), 
    212                 'firstname' => __('First name', 'wpsol'), 
    213                 'lastname' => __('Last name', 'wpsol'), 
     239                'fullname' => __('Full name', 'wpsol'),
     240                'firstname' => __('First name', 'wpsol'),
     241                'lastname' => __('Last name', 'wpsol'),
    214242                'username' => __('Username', 'wpsol'),
    215243            ),
     
    232260            'help' => __('By giving a prefix like sn_ you can easily identify which accounts are from Scouting Nederland', 'wpsol'),
    233261        ),
     262        'wpsol_login_redirect' => array(
     263            'name' => __('After a successful login redirect user to: ', 'wpsol'),
     264            'type' => 'select',
     265            'options' => array(
     266                'default' => __('Default (no action)', 'wpsol'),
     267                'frontpage' => __('Frontpage', 'wpsol'),
     268                'dashboard' => __('Dashboard', 'wpsol'),
     269            ),
     270        ),
     271        'wpsol_logout_redirect' => array(
     272            'name' => __('After logout redirect user to: ', 'wpsol'),
     273            'type' => 'select',
     274            'options' => array(
     275                'default' => __('Default (no action)', 'wpsol'),
     276                'frontpage' => __('Frontpage', 'wpsol'),
     277            ),
     278        ),
    234279    );
    235280
    236     // See if the user has posted us some information
    237     $hidden_field_name = 'wpsol_hidden';
    238     if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' )
     281    // See if the user has posted us some information
     282    $hidden_field_name = 'wpsol_hidden';
     283    if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' )
    239284    {
    240285        foreach($options as $key => $opt)
  • wpsol/trunk/languages/wpsol-nl_NL.po

    r926300 r998806  
    44msgid ""
    55msgstr ""
    6 "Project-Id-Version: wpSOL 0.5\n"
     6"Project-Id-Version: wpSOL 1.0.3\n"
    77"Report-Msgid-Bugs-To: http://wordpress.org/tag/wpsol\n"
    88"POT-Creation-Date: 2014-01-07 15:09:59+00:00\n"
     
    2121msgstr "Log in met je SOL account"
    2222
    23 #: common.php:202
     23#: common.php:230
    2424msgid "You do not have sufficient permissions to access this page."
    2525msgstr "Je hebt onvoldoende rechten voor het bekijken van deze pagina."
    2626
    27 #: common.php:208
     27#: common.php:236
    2828msgid "Set display_name to: "
    2929msgstr "Stel display_name in op: "
    3030
    31 #: common.php:211
     31#: common.php:239
    3232msgid "Full name"
    3333msgstr "Volledige naam"
    3434
    35 #: common.php:212
     35#: common.php:240
    3636msgid "First name"
    3737msgstr "Voornaam"
    3838
    39 #: common.php:213
     39#: common.php:241
    4040msgid "Last name"
    4141msgstr "Achternaam"
    4242
    43 #: common.php:214
     43#: common.php:242
    4444msgid "Username"
    4545msgstr "Gebruikersnaam"
    4646
    47 #: common.php:218
     47#: common.php:246
    4848msgid "Force display_name on each login: "
    4949msgstr "Forceer display_name bij elke login: "
    5050
    51 #: common.php:222
     51#: common.php:250
    5252msgid "Force first and last name on each login: "
    5353msgstr "Forceer voornaam en achternaam bij elke login: "
    5454
    55 #: common.php:226
     55#: common.php:254
    5656msgid "Automatically create new users: "
    5757msgstr "Automatisch nieuwe gebruikers aanmaken: "
    5858
    59 #: common.php:230
     59#: common.php:258
    6060msgid "Prefix for all Scouting Nederland users: "
    6161msgstr "Voorvoegsel voor alle Scouting Nederland users: "
    6262
    63 #: common.php:232
     63#: common.php:260
    6464msgid ""
    6565"By giving a prefix like sn_ you can easily identify which accounts are from "
     
    6969"Nederland makkelijk terugvinden"
    7070
    71 #: common.php:246
     71#: common.php:263
     72msgid "After a successful login redirect user to: "
     73msgstr "Na een succesvolle login redirect naar: "
     74
     75#: common.php:266 common.php:275
     76msgid "Default (no action)"
     77msgstr "Standaard (geen actie)"
     78
     79#: common.php:267 common.php:276
     80msgid "Frontpage"
     81msgstr "Frontpage"
     82
     83#: common.php:268
     84msgid "Dashboard"
     85msgstr "Dashboard"
     86
     87#: common.php:272
     88msgid "After logout redirect user to: "
     89msgstr "Na uitloggen redirect naar: "
     90
     91#: common.php:291
    7292msgid "Settings Saved"
    7393msgstr "Instellingen Opgeslagen"
    7494
    75 #: common.php:253
     95#: common.php:298
    7696msgid "wpSOL [ScoutsOnLine] Settings"
    7797msgstr "wpSOL [ScoutsOnLine] Instellingen"
    7898
    79 #: common.php:300
     99#: common.php:345
    80100msgid "Save Changes"
    81101msgstr "Wijzigingen Opslaan"
  • wpsol/trunk/languages/wpsol.pot

    r997971 r998806  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: wpSOL 1.0.2\n"
     5"Project-Id-Version: wpSOL 1.0.3\n"
    66"Report-Msgid-Bugs-To: http://wordpress.org/tag/wpsol\n"
    7 "POT-Creation-Date: 2014-09-28 00:00:00+00:00\n"
     7"POT-Creation-Date: 2014-09-29 00:00:00+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=UTF-8\n"
     
    1717msgstr ""
    1818
    19 #: common.php:202
     19#: common.php:230
    2020msgid "You do not have sufficient permissions to access this page."
    2121msgstr ""
    2222
    23 #: common.php:208
     23#: common.php:236
    2424msgid "Set display_name to: "
    2525msgstr ""
    2626
    27 #: common.php:211
     27#: common.php:239
    2828msgid "Full name"
    2929msgstr ""
    3030
    31 #: common.php:212
     31#: common.php:240
    3232msgid "First name"
    3333msgstr ""
    3434
    35 #: common.php:213
     35#: common.php:241
    3636msgid "Last name"
    3737msgstr ""
    3838
    39 #: common.php:214
     39#: common.php:242
    4040msgid "Username"
    4141msgstr ""
    4242
    43 #: common.php:218
     43#: common.php:246
    4444msgid "Force display_name on each login: "
    4545msgstr ""
    4646
    47 #: common.php:222
     47#: common.php:250
    4848msgid "Force first and last name on each login: "
    4949msgstr ""
    5050
    51 #: common.php:226
     51#: common.php:254
    5252msgid "Automatically create new users: "
    5353msgstr ""
    5454
    55 #: common.php:230
     55#: common.php:258
    5656msgid "Prefix for all Scouting Nederland users: "
    5757msgstr ""
    5858
    59 #: common.php:232
     59#: common.php:260
    6060msgid ""
    6161"By giving a prefix like sn_ you can easily identify which accounts are from "
     
    6363msgstr ""
    6464
    65 #: common.php:246
     65#: common.php:263
     66msgid "After a successful login redirect user to: "
     67msgstr ""
     68
     69#: common.php:266 common.php:275
     70msgid "Default (no action)"
     71msgstr ""
     72
     73#: common.php:267 common.php:276
     74msgid "Frontpage"
     75msgstr ""
     76
     77#: common.php:268
     78msgid "Dashboard"
     79msgstr ""
     80
     81#: common.php:272
     82msgid "After logout redirect user to: "
     83msgstr ""
     84
     85#: common.php:291
    6686msgid "Settings Saved"
    6787msgstr ""
    6888
    69 #: common.php:253
     89#: common.php:298
    7090msgid "wpSOL [ScoutsOnLine] Settings"
    7191msgstr ""
    7292
    73 #: common.php:300
     93#: common.php:345
    7494msgid "Save Changes"
    7595msgstr ""
  • wpsol/trunk/readme.txt

    r997971 r998806  
    4242== Changelog ==
    4343
     44= v1.0.3 =
     45* added a redirect option for login and logout to go to the frontpage
     46
    4447= v1.0.2 =
    4548* moved code from bitbucket to github
  • wpsol/trunk/wpsol.php

    r926412 r998806  
    66Author: Gerrit Jan and Dennis
    77Author URI: http://wordpress.org/plugins/wpsol/
    8 Version: 1.0.2
     8Version: 1.0.3
    99License:
    1010Text Domain: wpSOL
     
    2121
    2222    // Gebruikersnaam veld toevoegen aan de login pagina
    23     add_action( 'login_form', 'wpsol_wp_login_form' ); 
    24     add_filter( 'login_form_middle', 'wpsol_wp_login_form_middle' ); 
     23    add_action( 'login_form', 'wpsol_wp_login_form' );
     24    add_filter( 'login_form_middle', 'wpsol_wp_login_form_middle' );
    2525
    2626    // Inhaken op het authenticatie process
     
    3939add_action( 'admin_menu', 'wpsol_admin_menu' );
    4040
     41// add logout redirect
     42add_action( 'wp_logout', 'wpsol_logout_redirect');
     43
    4144// Setup defaults during installation
    4245register_activation_hook( __FILE__, 'wpsol_install' );
Note: See TracChangeset for help on using the changeset viewer.