WordPress.org

Plugin Directory

Changeset 217446


Ignore:
Timestamp:
03/14/10 12:33:13 (8 years ago)
Author:
jiangxin
Message:

code refactor. add cosign v3 as a new login method, and promotion to 0.3.1

Location:
cosign-sso/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cosign-sso/trunk/cosign-sso.php

    r217189 r217446  
    33Plugin Name: CoSign SSO 
    44Plugin URI:  http://redmine.ossxp.com/redmine/projects/show/wp 
    5 Description: Alternative authentication plugin for WordPress. This plugin add two login method: LDAP login and CoSign Single Sign-on(SSO) login. 
    6 Version: 0.3.0 
     5Description: Alternative authentication plugin for WordPress. This plugin add several login method: LDAP login and CoSign Single Sign-on(SSO) v2, v3 login. 
     6Version: 0.3.1 
    77Author: Jiang Xin <jiangxin AT ossxp.com> 
    88Author URI: http://www.ossxp.com/ 
     
    3131 */ 
    3232 
    33 define('COSIGN_SSO_VERSION', "0.1"); 
     33define('COSIGN_SSO_VERSION', "0.3"); 
    3434define('COSIGN_SSO_FALLBACK_FILE', dirname(__FILE__) . '/FALLBACK'); 
    35 define('COSIGN_LOGIN_DISABLED', 0); 
    36 define('COSIGN_LOGIN_LDAP',     1); 
    37 define('COSIGN_LOGIN_SSO',      2); 
     35define('SSO_LOGIN_DISABLED', 0); 
     36define('SSO_LOGIN_LDAP',     1); 
     37define('SSO_LOGIN_COSIGN_V2',      2); 
     38define('SSO_LOGIN_COSIGN_V3',      3); 
     39define('SSO_LOGIN_NO_FALLBACK',  999); 
    3840 
    3941require_once( ABSPATH . 'wp-includes/registration.php' ); 
     
    6062//Disable or fallback by 'FALLBACK' file 
    6163if( file_exists(COSIGN_SSO_FALLBACK_FILE)) { 
    62     if ( trim(strtolower(file_get_contents(COSIGN_SSO_FALLBACK_FILE))) == 'ldap' ) 
    63         $cosign_sso_fallback = COSIGN_LOGIN_LDAP; 
     64    $fallback_content = trim(strtolower(file_get_contents(COSIGN_SSO_FALLBACK_FILE))); 
     65    if ( $fallback_content == 'ldap' ) 
     66        $cosign_sso_fallback = SSO_LOGIN_LDAP; 
     67    elseif ( $fallback_content == 'cosign2' ) 
     68        $cosign_sso_fallback = SSO_LOGIN_COSIGN_V2; 
     69    elseif ( $fallback_content == 'cosign3' ) 
     70        $cosign_sso_fallback = SSO_LOGIN_COSIGN_V3; 
    6471    else 
    65         $cosign_sso_fallback = COSIGN_LOGIN_DISABLED; 
     72        $cosign_sso_fallback = SSO_LOGIN_DISABLED; 
    6673} else { 
    67     $cosign_sso_fallback = COSIGN_LOGIN_SSO; 
     74    $cosign_sso_fallback = SSO_LOGIN_NO_FALLBACK; 
    6875} 
    6976 
     
    8087//  Activation and Deactivation Functions 
    8188//---------------------------------------------------------------------------- 
     89 
     90function cosign_real_login_method() 
     91{ 
     92    global $cosign_sso_opt, $cosign_sso_fallback; 
     93 
     94    if ($cosign_sso_fallback != SSO_LOGIN_NO_FALLBACK) 
     95    { 
     96        return $cosign_sso_fallback; 
     97    } 
     98 
     99    // back compatible with v 0.3.0 
     100    if (isset($cosign_sso_opt["sso_protocol"]) && $cosign_sso_opt["sso_protocol"] == "3") 
     101    { 
     102        if ( (int)$cosign_sso_opt["login_method"] == SSO_LOGIN_COSIGN_V2 ) 
     103            $cosign_sso_opt["login_method"] = SSO_LOGIN_COSIGN_V3; 
     104    } 
     105 
     106    return (int)$cosign_sso_opt["login_method"]; 
     107} 
    82108 
    83109function cosign_sso_deactivate() 
     
    106132    // Setup Default Options Array 
    107133    $optionarray_def = array( 
    108         'login_method' => COSIGN_LOGIN_DISABLED, 
     134        'login_method' => SSO_LOGIN_DISABLED, 
    109135        'sso_login_url' => "https://foo.bar/cgi-bin/login", 
    110136        'sso_logout_url' => "https://foo.bar/cgi-bin/logout", 
    111         'sso_protocol' => "3", 
    112137        'sso_srv_name' => "wordpress", 
    113138        'auto_user' => '1', 
     
    163188 
    164189    $sso_login_url    = $cosign_sso_opt["sso_login_url"]; 
    165     if (isset($cosign_sso_opt["sso_protocol"])) 
    166         $sso_protocol  = $cosign_sso_opt["sso_protocol"]; 
    167     else 
    168         $sso_protocol  = "2"; 
    169190    $service_url  = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; 
    170191 
    171     if ($sso_protocol == "3") 
    172     { 
    173         ## CoSign protocol 3: redirect to weblogin only with cookie name. 
     192    if ( cosign_real_login_method() == SSO_LOGIN_COSIGN_V3 ) 
     193    { 
     194        ## CoSign V3: redirect to weblogin only with cookie name. 
    174195        ## It is the cgi's responsibility to generate cookie and the cookie is 
    175196        ## set by uri /cosign/valid/ of this domain. 
     
    177198        $dest_url = $sso_login_url . "?" . $cookie_name . "&" .  $service_url; 
    178199    } 
    179     else 
    180     { 
    181         ## CoSign protocol 2: set cookie first, then redirect to weblogin with 
     200    elseif ( cosign_real_login_method() == SSO_LOGIN_COSIGN_V2 ) 
     201    { 
     202        ## CoSign V2: set cookie first, then redirect to weblogin with 
    182203        ## cookie data in query string. 
    183204        $cookie_name = "cosign-" . $cosign_sso_opt["sso_srv_name"]; 
     
    237258    if ( is_a($user, 'WP_User') ) { return $user; } 
    238259 
    239     if ( (int)$cosign_sso_opt["login_method"] == COSIGN_LOGIN_SSO && 
    240           $cosign_sso_fallback != COSIGN_LOGIN_LDAP ) 
     260    if ( in_array( cosign_real_login_method(), array(SSO_LOGIN_COSIGN_V2, SSO_LOGIN_COSIGN_V3) ) ) 
    241261    { 
    242262        $username = $remote_user; 
     
    245265        } 
    246266    } 
    247     elseif ( (int)$cosign_sso_opt["login_method"] == COSIGN_LOGIN_LDAP || 
    248               $cosign_sso_fallback == COSIGN_LOGIN_LDAP ) 
     267    elseif ( cosign_real_login_method() == SSO_LOGIN_LDAP ) 
    249268    { 
    250269        if ( empty($username) || empty($password) ) { 
     
    357376            'sso_login_url' => $_POST['sso_login_url'], 
    358377            'sso_logout_url' => $_POST['sso_logout_url'], 
    359             'sso_protocol' => $_POST['sso_protocol'], 
    360378            'sso_srv_name' => $_POST['sso_srv_name'], 
    361379            'auto_user' => $_POST['auto_user'], 
     
    379397    // Get Options 
    380398    $optionarray_def = get_option('cosign_sso_options'); 
     399    $optionarray_def['login_method'] = cosign_real_login_method(); 
    381400 
    382401    // Setup Feed Key Reset Options 
    383402    $cosign_login_types = array( 
    384         __('Disabled', 'cosign_sso') => COSIGN_LOGIN_DISABLED, 
    385         __('LDAP', 'cosign_sso') => COSIGN_LOGIN_LDAP, 
    386         __('SSO', 'cosign_sso') => COSIGN_LOGIN_SSO, 
     403        __('Disabled', 'cosign_sso') => SSO_LOGIN_DISABLED, 
     404        __('LDAP', 'cosign_sso') => SSO_LOGIN_LDAP, 
     405        __('CoSign V3', 'cosign_sso') => SSO_LOGIN_COSIGN_V3, 
     406        __('CoSign V2', 'cosign_sso') => SSO_LOGIN_COSIGN_V2, 
    387407    ); 
    388408 
     
    400420?> 
    401421    <div class="wrap"> 
    402     <h2><?php _e("CoSign SSO Options", "cosign_sso"); ?></h2> 
     422    <h2><?php _e("Single SignOn Options", "cosign_sso"); ?></h2> 
    403423    <form method="post" action="<?php echo $_SERVER['PHP_SELF'] . '?page=' . basename(__FILE__); ?>&updated=true"> 
    404424    <fieldset class="options" style="border: none"> 
     
    408428             "<strong>Bad configuration will ban all users!!!</strong><br />". 
    409429                "If you are banned cause of the bad cosign sso login configurations, ". 
    410                 "simply create a file named <em>\"FALLBACK\"</em> (blank file or contains \"LDAP\") ". 
     430                "simply create a file named <em>\"FALLBACK\"</em> (blank file or contains \"LDAP\", \"COSIGN2\", \"COSIGN3\", ...) ". 
    411431                "under this plugin directory, or modify the database record by hands.", 
    412432                "cosign_sso"); 
     433 
     434    if($cosign_sso_fallback == SSO_LOGIN_DISABLED) 
     435        printf("<div><strong>". __("CoSign SSO login disable by file '%s'. To enable CoSign SSO login, remove that file.", "cosign_sso") . "</strong></div>", COSIGN_SSO_FALLBACK_FILE); 
     436    elseif($cosign_sso_fallback == SSO_LOGIN_LDAP) 
     437        printf("<div><strong>". __("Fallback to use LDAP auth mode. To enable CoSign SSO login, remove the file '%s'.", "cosign_sso") . "</strong></div>", COSIGN_SSO_FALLBACK_FILE); 
     438    elseif($cosign_sso_fallback == SSO_LOGIN_COSIGN_V2) 
     439        printf("<div><strong>". __("Fallback to use CoSign V2 auth mode. If this works, set login method to it and remove the file '%s'.", "cosign_sso") . "</strong></div>", COSIGN_SSO_FALLBACK_FILE); 
     440    elseif($cosign_sso_fallback == SSO_LOGIN_COSIGN_V3) 
     441        printf("<div><strong>". __("Fallback to use CoSign V3 auth mode. If this works, set login method to it and remove the file '%s'.", "cosign_sso") . "</strong></div>", COSIGN_SSO_FALLBACK_FILE); 
     442 
    413443    ?> 
    414444    </p> 
     
    420450                <span style="color: #555; font-size: .85em;"> 
    421451                <?php 
    422                     if($cosign_sso_fallback == COSIGN_LOGIN_DISABLED) 
    423                         printf("<strong>". __("CoSign SSO login disable by file '%s'. To enable CoSign SSO login, remove that file.", "cosign_sso") . "</strong><br />", COSIGN_SSO_FALLBACK_FILE); 
    424                     elseif($cosign_sso_fallback == COSIGN_LOGIN_LDAP) 
    425                         printf("<strong>". __("Fallback to use LDAP auth mode. To enable CoSign SSO login, remove the file '%s'.", "cosign_sso") . "</strong><br />", COSIGN_SSO_FALLBACK_FILE); 
    426452                    echo _e("Choose to disable internale auth login and authenticate all users using CoSign SSO login service.", "cosign_sso"); 
     453 
     454                    printf("<div><strong>". __("Notes: CoSign 2.x and 3.x are totally different in the core, and not compatible. If you choose wrong CoSign version, you can not login any more.", "cosign_sso") . "</strong></div>"); 
    427455                ?> 
    428456                </span> 
     
    442470            <td width="100px" colspan="2"><input type="text" name="sso_logout_url" size="50" value="<?php echo  $optionarray_def['sso_logout_url']; ?>"></td> 
    443471        </tr> 
    444         <tr valign="top"> 
    445             <th width="200px" scope="row"><?php echo __("CoSign Protocol", "cosign_sso"); ?></th> 
    446             <td width="100px"> 
    447                 <select name="sso_protocol"> 
    448                     <?php 
    449                     $cosign_protocol_types = array( 
    450                         __("for cosign 2.x", "cosign_sso") => "2", 
    451                         __("for cosign 3.x", "cosign_sso") => "3", 
    452                     ); 
    453  
    454                     foreach ($cosign_protocol_types as $option => $value) { 
    455                         if ($value == $optionarray_def['sso_protocol']) { 
    456                             $selected = 'selected="selected"'; 
    457                         } else { 
    458                             $selected = ''; 
    459                         } 
    460  
    461                         echo "\n\t<option value='$value' $selected>$option</option>"; 
    462                     } 
    463                     ?> 
    464                 </select> 
    465             </td> 
    466             <td> 
    467                 <span style="color: #555; font-size: .85em;"> 
    468                 <?php 
    469                     printf("<strong>". __("CoSign 2.x and 3.x use different protocol, and not compatible. If you choose wrong CoSign protocol version, you can not login any more.", "cosign_sso") . "</strong>"); 
    470                 ?> 
    471                 </span> 
    472             </td> 
    473         </tr> 
     472 
    474473        <tr valign="top"> 
    475474            <th width="200px" scope="row"><?php echo __("CoSign Service Name", "cosign_sso"); ?></th> 
     
    595594} 
    596595 
    597 if ( (int)$cosign_sso_opt['login_method'] > COSIGN_LOGIN_DISABLED 
    598      && $cosign_sso_fallback > COSIGN_LOGIN_DISABLED ) 
     596if ( cosign_real_login_method() > SSO_LOGIN_DISABLED ) 
    599597{ 
    600598    // Common hooks 
     
    606604    add_filter('allow_password_reset', 'cosign_sso_no_password_reset', 10, 0); 
    607605 
    608     if ( (int)$cosign_sso_opt['login_method'] == COSIGN_LOGIN_SSO && 
    609           $cosign_sso_fallback != COSIGN_LOGIN_LDAP ) 
    610     { 
    611         // Hoos for CoSign SSO 
     606    if ( in_array( cosign_real_login_method(), array(SSO_LOGIN_COSIGN_V2, SSO_LOGIN_COSIGN_V3) ) ) 
     607    { 
     608        // Hooks for CoSign SSO 
    612609        add_filter('authenticate', 'cosign_sso_authenticate', 10, 1); 
    613610        add_action('login_form_login', 'cosign_sso_login_redirect'); 
     
    615612        add_action('wp_logout', 'cosign_sso_logout_redirect'); 
    616613    } 
    617     elseif ( (int)$cosign_sso_opt['login_method'] == COSIGN_LOGIN_LDAP || 
    618               $cosign_sso_fallback == COSIGN_LOGIN_LDAP ) 
     614    elseif ( cosign_real_login_method() == SSO_LOGIN_LDAP ) 
    619615    { 
    620616        // Hoos for LDAP Login 
  • cosign-sso/trunk/languages/cosign_sso-zh_CN.po

    r217189 r217446  
    99"Project-Id-Version: CoSign SSO 0.1\n" 
    1010"Report-Msgid-Bugs-To: http://wordpress.org/tag/cosign-sso\n" 
    11 "POT-Creation-Date: 2010-03-14 12:02+0800\n" 
    12 "PO-Revision-Date: 2010-03-14 12:07+0800\n" 
     11"POT-Creation-Date: 2010-03-14 20:14+0800\n" 
     12"PO-Revision-Date: 2010-03-14 20:18+0800\n" 
    1313"Last-Translator: Jiang Xin <worldhello.net@gmail.com>\n" 
    1414"Language-Team: Chinese Simplified <kde-i18n-doc@kde.org>\n" 
     
    1919"Plural-Forms: nplurals=2; plural=n != 1;\n" 
    2020 
    21 #. #-#-#-#-#  x.pot (CoSign SSO 0.3.0)  #-#-#-#-# 
     21#. #-#-#-#-#  cosign_sso.pot (CoSign SSO 0.3.0)  #-#-#-#-# 
    2222#. Plugin Name of an extension 
    23 #: cosign-sso.php:141 
     23#: cosign-sso.php:166 
    2424msgid "CoSign SSO" 
    2525msgstr "单点登录" 
    2626 
    27 #: cosign-sso.php:244 
     27#: cosign-sso.php:264 
    2828msgid "CoSign login failed, no REMOTE_USER defined." 
    2929msgstr "单点登录失败,无法找到 REMOTE_USER 环境变量。" 
    3030 
    31 #: cosign-sso.php:244 cosign-sso.php:278 
     31#: cosign-sso.php:264 cosign-sso.php:297 
    3232msgid "login failed" 
    3333msgstr "登录失败" 
    3434 
    35 #: cosign-sso.php:254 
     35#: cosign-sso.php:273 
    3636msgid "<strong>ERROR</strong>: The username field is empty." 
    3737msgstr "<strong>错误</strong>: 用户名字段为空。" 
    3838 
    39 #: cosign-sso.php:257 
     39#: cosign-sso.php:276 
    4040msgid "<strong>ERROR</strong>: The password field is empty." 
    4141msgstr "<strong>错误</strong>: 口令字段为空。" 
    4242 
    43 #: cosign-sso.php:264 
     43#: cosign-sso.php:283 
    4444#, php-format 
    4545msgid "" 
     
    5050"Found\">忘记口令</a>?" 
    5151 
    52 #: cosign-sso.php:278 
     52#: cosign-sso.php:297 
    5353msgid "" 
    5454"Invalid username. Turn on auto_user to create user account automatically." 
    5555msgstr "错误用户名。打开 auto_user 实现用户自动创建。" 
    5656 
    57 #: cosign-sso.php:319 
     57#: cosign-sso.php:338 
    5858msgid "" 
    5959"Note: Some fields of profile store in LDAP and can not be changed here. " 
     
    6161msgstr "注意:一些字段保存在 LDAP 中,不能在此界面中修改。" 
    6262 
    63 #: cosign-sso.php:384 
     63#: cosign-sso.php:403 
    6464msgid "Disabled" 
    6565msgstr "禁用" 
    6666 
    67 #: cosign-sso.php:385 
     67#: cosign-sso.php:404 
    6868msgid "LDAP" 
    6969msgstr "LDAP认证" 
    7070 
    71 #: cosign-sso.php:386 
    72 msgid "SSO" 
    73 msgstr "单点登录认证" 
    74  
    75 #: cosign-sso.php:402 cosign-sso.php:434 
    76 msgid "CoSign SSO Options" 
     71#: cosign-sso.php:405 
     72msgid "CoSign V3" 
     73msgstr "单点登录:CoSign 3.x" 
     74 
     75#: cosign-sso.php:406 
     76msgid "CoSign V2" 
     77msgstr "单点登录:CoSign 2.x" 
     78 
     79#: cosign-sso.php:422 
     80msgid "Single SignOn Options" 
    7781msgstr "单点登录选项" 
    7882 
    79 #: cosign-sso.php:407 
     83#: cosign-sso.php:427 
    8084msgid "" 
    8185"Checking the <em>CoSign SSO</em> option below, it will change login method " 
     
    8387"will ban all users!!!</strong><br />If you are banned cause of the bad " 
    8488"cosign sso login configurations, simply create a file named <em>\"FALLBACK" 
    85 "\"</em> (blank file or contains \"LDAP\") under this plugin directory, or " 
    86 "modify the database record by hands." 
     89"\"</em> (blank file or contains \"LDAP\", \"COSIGN2\", \"COSIGN3\", ...) " 
     90"under this plugin directory, or modify the database record by hands." 
    8791msgstr "" 
    8892"检查下面的 <em>单点登录</em> 设置,它将改变认证方式,会影响所有用户包括你自" 
    8993"己。 <br /><strong>错误的设置将会让所有用户无法登录!!!</strong><br />如果" 
    9094"您因此而无法登录系统,可以在服务器端本插件目录下创建一个名为 <em>\"FALLBACK" 
    91 "\"</em> 的文件(空文件或者包含\"LDAP\"),或者您也可以通过修改数据库恢复原有" 
     95"\"</em> 的文件(空文件或者包含\"LDAP\", \"COSIGN2\", \"COSIGN3\", ...),或者您也可以通过修改数据库恢复原有" 
    9296"认证方式。" 
    9397 
    94 #: cosign-sso.php:417 
    95 msgid "Login method" 
    96 msgstr "登录方式" 
    97  
    98 #: cosign-sso.php:423 
     98#: cosign-sso.php:435 
    9999#, php-format 
    100100msgid "" 
     
    103103msgstr "单点登录因为文件 '%s' 而禁用。重新启用单点登录,请删除该文件。" 
    104104 
    105 #: cosign-sso.php:425 
     105#: cosign-sso.php:437 
    106106#, php-format 
    107107msgid "" 
     
    110110msgstr "回退到 LDAP 认证模式。重新启用单点登录,请删除文件 '%s'。" 
    111111 
    112 #: cosign-sso.php:426 
     112#: cosign-sso.php:439 
     113#, php-format 
     114msgid "" 
     115"Fallback to use CoSign V2 auth mode. If this works, set login method to it " 
     116"and remove the file '%s'." 
     117msgstr "回退到 CoSign 2.x 认证模式。重新启用单点登录,请删除文件 '%s'。" 
     118 
     119#: cosign-sso.php:441 
     120#, php-format 
     121msgid "" 
     122"Fallback to use CoSign V3 auth mode. If this works, set login method to it " 
     123"and remove the file '%s'." 
     124msgstr "回退到 CoSign 3.x 认证模式。重新启用单点登录,请删除文件 '%s'。" 
     125 
     126#: cosign-sso.php:447 
     127msgid "Login method" 
     128msgstr "登录方式" 
     129 
     130#: cosign-sso.php:452 
    113131msgid "" 
    114132"Choose to disable internale auth login and authenticate all users using " 
     
    116134msgstr "选择不同的登录方式。缺省禁用单点登录。" 
    117135 
    118 #: cosign-sso.php:437 
     136#: cosign-sso.php:454 
     137msgid "" 
     138"Notes: CoSign 2.x and 3.x are totally different in the core, and not " 
     139"compatible. If you choose wrong CoSign version, you can not login any more." 
     140msgstr "" 
     141"注意:CoSign 2.x 和 3.x 版本采用了不同的协议,互不兼容。如果选择了错误的协议类型," 
     142"您将无法登录。" 
     143 
     144#: cosign-sso.php:462 
     145msgid "CoSign SSO Options" 
     146msgstr "单点登录选项" 
     147 
     148#: cosign-sso.php:465 
    119149msgid "CoSign Login URL" 
    120150msgstr "单点登录的登录URL地址" 
    121151 
    122 #: cosign-sso.php:441 
     152#: cosign-sso.php:469 
    123153msgid "CoSign Logout URL" 
    124154msgstr "单点登录的退出URL地址" 
    125155 
    126 #: cosign-sso.php:445 
    127 msgid "CoSign Protocol" 
    128 msgstr "CoSign 协议" 
    129  
    130 #: cosign-sso.php:450 
    131 msgid "for cosign 2.x" 
    132 msgstr "支持 cosign 2.x" 
    133  
    134 #: cosign-sso.php:451 
    135 msgid "for cosign 3.x" 
    136 msgstr "支持 cosign 3.x" 
    137  
    138 #: cosign-sso.php:469 
    139 msgid "" 
    140 "CoSign 2.x and 3.x use different protocol, and not compatible. If you choose " 
    141 "wrong CoSign protocol version, you can not login any more." 
    142 msgstr "CoSign 2.x 和 3.x 版本采用了不同的协议,互不兼容。如果选择了错误的协议类型,您将无法登录。" 
    143  
    144 #: cosign-sso.php:475 
     156#: cosign-sso.php:474 
    145157msgid "CoSign Service Name" 
    146158msgstr "单点登录的服务名" 
    147159 
    148 #: cosign-sso.php:480 
     160#: cosign-sso.php:479 
    149161msgid "" 
    150162"Must match with the settings of cosign filter, and/or cosign daemon. If you " 
    151163"are not sure, ask for it form webmaster." 
    152 msgstr "服务名必须和 cosign 过滤器,cosign 服务的设置相匹配。如果您不确定,请咨询管理员。" 
    153  
    154 #: cosign-sso.php:487 
     164msgstr "" 
     165"服务名必须和 cosign 过滤器,cosign 服务的设置相匹配。如果您不确定,请咨询管理" 
     166"员。" 
     167 
     168#: cosign-sso.php:486 
    155169msgid "User Account" 
    156170msgstr "用户帐号" 
    157171 
    158 #: cosign-sso.php:490 
     172#: cosign-sso.php:489 
    159173msgid "Auto create user account" 
    160174msgstr "自动创建用户帐号" 
    161175 
    162 #: cosign-sso.php:493 
     176#: cosign-sso.php:492 
    163177msgid "new user as" 
    164178msgstr "新用户角色" 
    165179 
    166 #: cosign-sso.php:501 cosign-sso.php:503 
     180#: cosign-sso.php:500 cosign-sso.php:502 
    167181msgid "&mdash; No role for this blog &mdash;" 
    168182msgstr "&mdash; 本博客中无权限 &mdash;" 
    169183 
    170 #: cosign-sso.php:510 
     184#: cosign-sso.php:509 
    171185msgid "LDAP Options" 
    172186msgstr "LDAP 选项" 
    173187 
    174 #: cosign-sso.php:513 
     188#: cosign-sso.php:512 
    175189msgid "LDAP hostname" 
    176190msgstr "LDAP 主机名" 
    177191 
    178 #: cosign-sso.php:518 
     192#: cosign-sso.php:517 
    179193msgid "LDAP port" 
    180194msgstr "LDAP 端口" 
    181195 
    182 #: cosign-sso.php:524 
     196#: cosign-sso.php:523 
    183197msgid "LDAP BaseDN" 
    184198msgstr "LDAP BaseDN" 
    185199 
    186 #: cosign-sso.php:529 
     200#: cosign-sso.php:528 
    187201msgid "LDAP Bind Username" 
    188202msgstr "LDAP 绑定用户名" 
    189203 
    190 #: cosign-sso.php:534 
     204#: cosign-sso.php:533 
    191205msgid "LDAP Bind Password" 
    192206msgstr "LDAP 绑定口令" 
    193207 
    194 #: cosign-sso.php:539 
     208#: cosign-sso.php:538 
    195209msgid "LDAP Search Filter" 
    196210msgstr "LDAP 搜索过滤器" 
    197211 
    198 #: cosign-sso.php:544 
     212#: cosign-sso.php:543 
    199213msgid "Login Name" 
    200214msgstr "登录名字段" 
    201215 
    202 #: cosign-sso.php:549 
     216#: cosign-sso.php:548 
    203217msgid "Given Name" 
    204218msgstr "名字字段" 
    205219 
    206 #: cosign-sso.php:554 
     220#: cosign-sso.php:553 
    207221msgid "Surname" 
    208222msgstr "姓氏字段" 
    209223 
    210 #: cosign-sso.php:559 
     224#: cosign-sso.php:558 
    211225msgid "Nick Name" 
    212226msgstr "别名字段" 
    213227 
    214 #: cosign-sso.php:564 
     228#: cosign-sso.php:563 
    215229msgid "Email" 
    216230msgstr "Email 字段" 
    217231 
    218 #: cosign-sso.php:573 
     232#: cosign-sso.php:572 
    219233msgid "Update Options" 
    220234msgstr "保存" 
     
    239253msgid "http://www.ossxp.com/" 
    240254msgstr "http://www.ossxp.com/" 
     255 
     256#~ msgid "SSO" 
     257#~ msgstr "单点登录认证" 
     258 
     259#~ msgid "CoSign Protocol" 
     260#~ msgstr "CoSign 协议" 
     261 
     262#~ msgid "for cosign 2.x" 
     263#~ msgstr "支持 cosign 2.x" 
     264 
     265#~ msgid "for cosign 3.x" 
     266#~ msgstr "支持 cosign 3.x" 
    241267 
    242268#~ msgid "Jiang Xin" 
  • cosign-sso/trunk/languages/cosign_sso.pot

    r217189 r217446  
    99"Project-Id-Version: CoSign SSO 0.3.0\n" 
    1010"Report-Msgid-Bugs-To: http://wordpress.org/tag/cosign-sso\n" 
    11 "POT-Creation-Date: 2010-03-14 12:02+0800\n" 
     11"POT-Creation-Date: 2010-03-14 20:14+0800\n" 
    1212"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" 
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 
     
    1717"Content-Transfer-Encoding: 8bit\n" 
    1818 
    19 #. #-#-#-#-#  x.pot (CoSign SSO 0.3.0)  #-#-#-#-# 
     19#. #-#-#-#-#  cosign_sso.pot (CoSign SSO 0.3.0)  #-#-#-#-# 
    2020#. Plugin Name of an extension 
    21 #: cosign-sso.php:141 
     21#: cosign-sso.php:166 
    2222msgid "CoSign SSO" 
    2323msgstr "" 
    2424 
    25 #: cosign-sso.php:244 
     25#: cosign-sso.php:264 
    2626msgid "CoSign login failed, no REMOTE_USER defined." 
    2727msgstr "" 
    2828 
    29 #: cosign-sso.php:244 cosign-sso.php:278 
     29#: cosign-sso.php:264 cosign-sso.php:297 
    3030msgid "login failed" 
    3131msgstr "" 
    3232 
    33 #: cosign-sso.php:254 
     33#: cosign-sso.php:273 
    3434msgid "<strong>ERROR</strong>: The username field is empty." 
    3535msgstr "" 
    3636 
    37 #: cosign-sso.php:257 
     37#: cosign-sso.php:276 
    3838msgid "<strong>ERROR</strong>: The password field is empty." 
    3939msgstr "" 
    4040 
    41 #: cosign-sso.php:264 
     41#: cosign-sso.php:283 
    4242#, php-format 
    4343msgid "" 
     
    4646msgstr "" 
    4747 
    48 #: cosign-sso.php:278 
     48#: cosign-sso.php:297 
    4949msgid "" 
    5050"Invalid username. Turn on auto_user to create user account automatically." 
    5151msgstr "" 
    5252 
    53 #: cosign-sso.php:319 
     53#: cosign-sso.php:338 
    5454msgid "" 
    5555"Note: Some fields of profile store in LDAP and can not be changed here. " 
     
    5757msgstr "" 
    5858 
    59 #: cosign-sso.php:384 
     59#: cosign-sso.php:403 
    6060msgid "Disabled" 
    6161msgstr "" 
    6262 
    63 #: cosign-sso.php:385 
     63#: cosign-sso.php:404 
    6464msgid "LDAP" 
    6565msgstr "" 
    6666 
    67 #: cosign-sso.php:386 
    68 msgid "SSO" 
    69 msgstr "" 
    70  
    71 #: cosign-sso.php:402 cosign-sso.php:434 
    72 msgid "CoSign SSO Options" 
    73 msgstr "" 
    74  
    75 #: cosign-sso.php:407 
     67#: cosign-sso.php:405 
     68msgid "CoSign V3" 
     69msgstr "" 
     70 
     71#: cosign-sso.php:406 
     72msgid "CoSign V2" 
     73msgstr "" 
     74 
     75#: cosign-sso.php:422 
     76msgid "Single SignOn Options" 
     77msgstr "" 
     78 
     79#: cosign-sso.php:427 
    7680msgid "" 
    7781"Checking the <em>CoSign SSO</em> option below, it will change login method " 
     
    7983"will ban all users!!!</strong><br />If you are banned cause of the bad " 
    8084"cosign sso login configurations, simply create a file named <em>\"FALLBACK" 
    81 "\"</em> (blank file or contains \"LDAP\") under this plugin directory, or " 
    82 "modify the database record by hands." 
    83 msgstr "" 
    84  
    85 #: cosign-sso.php:417 
    86 msgid "Login method" 
    87 msgstr "" 
    88  
    89 #: cosign-sso.php:423 
     85"\"</em> (blank file or contains \"LDAP\", \"COSIGN2\", \"COSIGN3\", ...) " 
     86"under this plugin directory, or modify the database record by hands." 
     87msgstr "" 
     88 
     89#: cosign-sso.php:435 
    9090#, php-format 
    9191msgid "" 
     
    9494msgstr "" 
    9595 
    96 #: cosign-sso.php:425 
     96#: cosign-sso.php:437 
    9797#, php-format 
    9898msgid "" 
     
    101101msgstr "" 
    102102 
    103 #: cosign-sso.php:426 
     103#: cosign-sso.php:439 
     104#, php-format 
     105msgid "" 
     106"Fallback to use CoSign V2 auth mode. If this works, set login method to it " 
     107"and remove the file '%s'." 
     108msgstr "" 
     109 
     110#: cosign-sso.php:441 
     111#, php-format 
     112msgid "" 
     113"Fallback to use CoSign V3 auth mode. If this works, set login method to it " 
     114"and remove the file '%s'." 
     115msgstr "" 
     116 
     117#: cosign-sso.php:447 
     118msgid "Login method" 
     119msgstr "" 
     120 
     121#: cosign-sso.php:452 
    104122msgid "" 
    105123"Choose to disable internale auth login and authenticate all users using " 
     
    107125msgstr "" 
    108126 
    109 #: cosign-sso.php:437 
     127#: cosign-sso.php:454 
     128msgid "" 
     129"Notes: CoSign 2.x and 3.x are totally different in the core, and not " 
     130"compatible. If you choose wrong CoSign version, you can not login any more." 
     131msgstr "" 
     132 
     133#: cosign-sso.php:462 
     134msgid "CoSign SSO Options" 
     135msgstr "" 
     136 
     137#: cosign-sso.php:465 
    110138msgid "CoSign Login URL" 
    111139msgstr "" 
    112140 
    113 #: cosign-sso.php:441 
     141#: cosign-sso.php:469 
    114142msgid "CoSign Logout URL" 
    115143msgstr "" 
    116144 
    117 #: cosign-sso.php:445 
    118 msgid "CoSign Protocol" 
    119 msgstr "" 
    120  
    121 #: cosign-sso.php:450 
    122 msgid "for cosign 2.x" 
    123 msgstr "" 
    124  
    125 #: cosign-sso.php:451 
    126 msgid "for cosign 3.x" 
    127 msgstr "" 
    128  
    129 #: cosign-sso.php:469 
    130 msgid "" 
    131 "CoSign 2.x and 3.x use different protocol, and not compatible. If you choose " 
    132 "wrong CoSign protocol version, you can not login any more." 
    133 msgstr "" 
    134  
    135 #: cosign-sso.php:475 
     145#: cosign-sso.php:474 
    136146msgid "CoSign Service Name" 
    137147msgstr "" 
    138148 
    139 #: cosign-sso.php:480 
     149#: cosign-sso.php:479 
    140150msgid "" 
    141151"Must match with the settings of cosign filter, and/or cosign daemon. If you " 
     
    143153msgstr "" 
    144154 
    145 #: cosign-sso.php:487 
     155#: cosign-sso.php:486 
    146156msgid "User Account" 
    147157msgstr "" 
    148158 
    149 #: cosign-sso.php:490 
     159#: cosign-sso.php:489 
    150160msgid "Auto create user account" 
    151161msgstr "" 
    152162 
    153 #: cosign-sso.php:493 
     163#: cosign-sso.php:492 
    154164msgid "new user as" 
    155165msgstr "" 
    156166 
    157 #: cosign-sso.php:501 cosign-sso.php:503 
     167#: cosign-sso.php:500 cosign-sso.php:502 
    158168msgid "&mdash; No role for this blog &mdash;" 
    159169msgstr "" 
    160170 
    161 #: cosign-sso.php:510 
     171#: cosign-sso.php:509 
    162172msgid "LDAP Options" 
    163173msgstr "" 
    164174 
    165 #: cosign-sso.php:513 
     175#: cosign-sso.php:512 
    166176msgid "LDAP hostname" 
    167177msgstr "" 
    168178 
    169 #: cosign-sso.php:518 
     179#: cosign-sso.php:517 
    170180msgid "LDAP port" 
    171181msgstr "" 
    172182 
    173 #: cosign-sso.php:524 
     183#: cosign-sso.php:523 
    174184msgid "LDAP BaseDN" 
    175185msgstr "" 
    176186 
    177 #: cosign-sso.php:529 
     187#: cosign-sso.php:528 
    178188msgid "LDAP Bind Username" 
    179189msgstr "" 
    180190 
    181 #: cosign-sso.php:534 
     191#: cosign-sso.php:533 
    182192msgid "LDAP Bind Password" 
    183193msgstr "" 
    184194 
    185 #: cosign-sso.php:539 
     195#: cosign-sso.php:538 
    186196msgid "LDAP Search Filter" 
    187197msgstr "" 
    188198 
    189 #: cosign-sso.php:544 
     199#: cosign-sso.php:543 
    190200msgid "Login Name" 
    191201msgstr "" 
    192202 
    193 #: cosign-sso.php:549 
     203#: cosign-sso.php:548 
    194204msgid "Given Name" 
    195205msgstr "" 
    196206 
    197 #: cosign-sso.php:554 
     207#: cosign-sso.php:553 
    198208msgid "Surname" 
    199209msgstr "" 
    200210 
    201 #: cosign-sso.php:559 
     211#: cosign-sso.php:558 
    202212msgid "Nick Name" 
    203213msgstr "" 
    204214 
    205 #: cosign-sso.php:564 
     215#: cosign-sso.php:563 
    206216msgid "Email" 
    207217msgstr "" 
    208218 
    209 #: cosign-sso.php:573 
     219#: cosign-sso.php:572 
    210220msgid "Update Options" 
    211221msgstr "" 
  • cosign-sso/trunk/readme.txt

    r217193 r217446  
    44Donate link:  
    55Requires at least: unknown 
    6 Tested up to: 2.9.1 
    7 Stable tag: 0.3.0 
     6Tested up to: 2.9.2 
     7Stable tag: 0.3.1 
    88 
    9 Alternative authentication plugin for WordPress. This plugin add two login method: LDAP login and CoSign Single Sign-on(SSO) login. 
     9Alternative authentication plugin for WordPress. This plugin add several login method: LDAP login and two Single Sign-on(SSO) login method: CoSign V2, CoSign V3. 
    1010 
    1111== Description == 
    1212 
    13 **CoSign SSO** is a WordPress plugin that provides two alternative authentication methods to WordPress. One is CoSign Single Sign-on(SSO) login integration, and the other is a by-product which provides LDAP authentication. 
     13**CoSign SSO** is a WordPress plugin that provides several alternative authentication methods to WordPress, and it maybe easily extend to support more SSO login methods. CoSign v2 and CoSign v3 are the first two Single Sign-on(SSO) addins, that whay this plugin named. The other login method is just a by-product which provides LDAP authentication. 
    1414 
    1515When this plugin is enabled, and the login method is set to *SSO*, then using a external CoSign single sign-on login service. When user click login, browser will redirect to remote login url, and will redirect back after successful logged in. If set login method to *LDAP*, login with the familiar login screen, but authentication backend changed to LDAP. 
     
    3434 
    3535    $ touch <PLUGIN_DIR>/cosign-sso/FALLBACK 
     36 
     37If the fallback file contains "ldap", "cosign2", or "cosign3", it will fallback to the right login method. 
    3638 
    3739After you correct the settings, not forgot to remove the *FALLBACK* file. 
     
    6365 
    6466== Changelog == 
     67= 0.3.1 = 
     68 
     691. Code refactor. 
     702. Add CoSign v3 support as a new login method. 
     71 
    6572= 0.3.0 = 
    6673 
Note: See TracChangeset for help on using the changeset viewer.