Changeset 1558 in ExiteCMS


Ignore:
Timestamp:
07/30/08 16:04:17 (4 years ago)
Author:
hverton
Message:

added preliminary support for multiple authentication methods. Currently, local database and OpenID are supported

Location:
trunk
Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/settings_security.php

    r1342 r1558  
    4040    } 
    4141    if ($variables['errormessage'] == "") { 
    42         $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['enable_registration']) ? $_POST['enable_registration'] : "1")."' WHERE cfg_name = 'enable_registration'"); 
    43         $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['email_verification']) ? $_POST['email_verification'] : "1")."' WHERE cfg_name = 'email_verification'"); 
    44         $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['admin_activation']) ? $_POST['admin_activation'] : "0")."' WHERE cfg_name = 'admin_activation'"); 
    45         $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['display_validation']) ? $_POST['display_validation'] : "1")."' WHERE cfg_name = 'display_validation'"); 
    46         $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".stripinput($_POST['validation_method'])."' WHERE cfg_name = 'validation_method'"); 
    47         $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '$session_timeout' WHERE cfg_name = 'session_gc_maxlifetime'"); 
    48         $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '$login_expire' WHERE cfg_name = 'login_expire'"); 
    49         $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '$login_extended_expire' WHERE cfg_name = 'login_extended_expire'"); 
     42        // authentication method check 
     43        $auth_method = $_POST['auth_method']{0}; 
     44        $auth_local = $_POST['auth_method']{1} == "+" ? "1" : "0"; 
     45        switch ($auth_method) { 
     46            case "1":   // LDAP 
     47                if ($auth_local) { 
     48                    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = 'ldap,local' WHERE cfg_name = 'auth_type'"); 
     49                } else { 
     50                    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = 'ldap' WHERE cfg_name = 'auth_type'"); 
     51                } 
     52                break; 
     53            case "2":   // AD 
     54                if ($auth_local) { 
     55                    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = 'ad,local' WHERE cfg_name = 'auth_type'"); 
     56                } else { 
     57                    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = 'ad' WHERE cfg_name = 'auth_type'"); 
     58                } 
     59                break; 
     60            case "3":   // OpenID 
     61                if ($auth_local) { 
     62                    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = 'openid,local' WHERE cfg_name = 'auth_type'"); 
     63                } else { 
     64                    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = 'openid' WHERE cfg_name = 'auth_type'"); 
     65                } 
     66                break; 
     67            default: 
     68                $variables['errormessage'] = "Invalid authentication method. This may never happen!"; 
     69        } 
     70        if ($variables['errormessage'] == "") { 
     71            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['enable_registration']) ? $_POST['enable_registration'] : "1")."' WHERE cfg_name = 'enable_registration'"); 
     72            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['email_verification']) ? $_POST['email_verification'] : "1")."' WHERE cfg_name = 'email_verification'"); 
     73            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['admin_activation']) ? $_POST['admin_activation'] : "0")."' WHERE cfg_name = 'admin_activation'"); 
     74            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['display_validation']) ? $_POST['display_validation'] : "1")."' WHERE cfg_name = 'display_validation'"); 
     75            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".stripinput($_POST['validation_method'])."' WHERE cfg_name = 'validation_method'"); 
     76            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '$session_timeout' WHERE cfg_name = 'session_gc_maxlifetime'"); 
     77            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '$login_expire' WHERE cfg_name = 'login_expire'"); 
     78            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '$login_extended_expire' WHERE cfg_name = 'login_extended_expire'"); 
     79        } 
    5080    } 
    5181} 
     
    75105} 
    76106 
     107// determine the auth_method defined 
     108$auth_methods = explode(",",$settings2['auth_type'].","); 
     109switch($auth_methods[0]) { 
     110    case "ldap": 
     111        $auth_method = 1; 
     112        break; 
     113    case "ad": 
     114        $auth_method = 2; 
     115        break; 
     116    case "openid": 
     117        $auth_method = 3; 
     118    case "local": 
     119        break; 
     120    default: 
     121        $auth_method = 0; 
     122} 
     123$variables['auth_method'] = $auth_method; 
     124 
     125// check if a local fallback is defined 
     126if ($auth_method && $auth_methods[1] == "local") { 
     127    $variables['auth_method'] .= "+"; 
     128} 
     129 
    77130// define the admin body panel 
    78131$template_panels[] = array('type' => 'body', 'name' => 'admin.settings_security', 'template' => 'admin.settings_security.tpl', 'locale' => "admin.settings"); 
  • trunk/administration/tools/language_pack_English.php

    r1533 r1558  
    705705        $localestrings['543'] = "News Item"; 
    706706        $localestrings['544'] = "Update"; 
    707         $localestrings['545'] = "On this page you define the sequence in which the news articles are displayed on the news homepage. \n                 First, all headlines you selected are displayed. After that, the latest news items. Both in the order\n                 in which they are selected.<br />If the checkbox below is not checked, all other news items that are not\n                  expired will be shown next."; 
     707        $localestrings['545'] = "On this page you define the sequence in which the news articles are displayed on the news homepage. \n                 First, all headlines you selected are displayed. After that, the latest news items. Both in the order\n                 in which they are selected.<br />If the checkbox below is not checked, all other news items that are not\nexpired will be shown next."; 
    708708        $localestrings['546'] = "Hide all non-selected news items from the Latest News page"; 
    709709        $localestrings['550'] = "Please specify a subject"; 
     
    988988        $localestrings['535'] = "Hour"; 
    989989        $localestrings['536'] = "Hours"; 
     990        $localestrings['537'] = "Authentication Method:"; 
     991        $localestrings['538'] = "Local database"; 
     992        $localestrings['539'] = "LDAP Server"; 
     993        $localestrings['540'] = "Active Directory Server"; 
     994        $localestrings['541'] = ", then "; 
     995        $localestrings['542'] = ", with OpenID"; 
    990996        $localestrings['550'] = "Security"; 
    991997        $localestrings['551'] = "Enable registration system?"; 
     
    14201426        $localestrings['pl'] = "Poland"; 
    14211427        $localestrings['pm'] = "Saint Pierre And Miquelon"; 
    1422         $localestrings['pr'] = "Palestinian Territories"; 
     1428        $localestrings['pr'] = "Puerto Rico"; 
     1429        $localestrings['ps'] = "Palestinian Territories"; 
    14231430        $localestrings['pt'] = "Portugal"; 
    14241431        $localestrings['pw'] = "Palau"; 
     
    14861493 
    14871494        $localestrings = array(); 
    1488         $localestrings['Abu Dhabi'] = "ae"; 
    1489         $localestrings['Afghanistan'] = "af"; 
    1490         $localestrings['Albania'] = "al"; 
    1491         $localestrings['Algeria'] = "dz"; 
    1492         $localestrings['American Samoa'] = "as"; 
    1493         $localestrings['Andorra'] = "ad"; 
    1494         $localestrings['Angola'] = "ao"; 
    1495         $localestrings['Anguilla'] = "ai"; 
    1496         $localestrings['Antigua And Barbuda'] = "ag"; 
    1497         $localestrings['Argentina'] = "ar"; 
    1498         $localestrings['Armenia'] = "am"; 
    1499         $localestrings['Aruba'] = "aw"; 
    1500         $localestrings['Australia'] = "au"; 
    1501         $localestrings['Austria'] = "at"; 
     1495        $localestrings['abu dhabi'] = "ae"; 
     1496        $localestrings['afghanistan'] = "af"; 
     1497        $localestrings['albania'] = "al"; 
     1498        $localestrings['algeria'] = "dz"; 
     1499        $localestrings['american samoa'] = "as"; 
     1500        $localestrings['andorra'] = "ad"; 
     1501        $localestrings['angola'] = "ao"; 
     1502        $localestrings['anguilla'] = "ai"; 
     1503        $localestrings['antigua and barbuda'] = "ag"; 
     1504        $localestrings['argentina'] = "ar"; 
     1505        $localestrings['armenia'] = "am"; 
     1506        $localestrings['aruba'] = "aw"; 
     1507        $localestrings['australia'] = "au"; 
     1508        $localestrings['austria'] = "at"; 
    15021509        $localestrings['azerbaidjan'] = "az"; 
    1503         $localestrings['Azerbaijan'] = "az"; 
    1504         $localestrings['Bahamas'] = "bs"; 
    1505         $localestrings['Bahrain'] = "bh"; 
    1506         $localestrings['Bangladesh'] = "bd"; 
    1507         $localestrings['Barbados'] = "bb"; 
    1508         $localestrings['Belarus'] = "by"; 
    1509         $localestrings['Belgium'] = "be"; 
    1510         $localestrings['Belize'] = "bz"; 
    1511         $localestrings['Benin'] = "bj"; 
    1512         $localestrings['Bermuda'] = "bm"; 
    1513         $localestrings['Bhutan'] = "bt"; 
    1514         $localestrings['Bolivia'] = "bo"; 
    1515         $localestrings['Bosnia And Herzegovina'] = "ba"; 
    1516         $localestrings['Bosnia Herzegovina'] = "ba"; 
    1517         $localestrings['Botswana'] = "bw"; 
    1518         $localestrings['Bouvet Island'] = "bv"; 
    1519         $localestrings['Brazil'] = "br"; 
    1520         $localestrings['British Indian Ocean Terr'] = "io"; 
    1521         $localestrings['British Virgin Islands'] = "vg"; 
    1522         $localestrings['Brunei Darussalam'] = "bn"; 
    1523         $localestrings['Bulgaria'] = "bg"; 
    1524         $localestrings['Burkina Faso'] = "bf"; 
    1525         $localestrings['Burundi'] = "bi"; 
    1526         $localestrings['Cambodia'] = "kh"; 
    1527         $localestrings['Cameroon'] = "cm"; 
    1528         $localestrings['Canada'] = "ca"; 
    1529         $localestrings['Cape Verde'] = "cv"; 
    1530         $localestrings['Cayman Islands'] = "ky"; 
    1531         $localestrings['Central African Republic'] = "cf"; 
    1532         $localestrings['Chad'] = "td"; 
    1533         $localestrings['Chile'] = "cl"; 
    1534         $localestrings['China'] = "cn"; 
    1535         $localestrings['Christmas Island'] = "cx"; 
    1536         $localestrings['Cocos (Keeling) Islands'] = "cc"; 
    1537         $localestrings['Colombia'] = "co"; 
    1538         $localestrings['Comoros'] = "km"; 
    1539         $localestrings['Congo'] = "cg"; 
    1540         $localestrings['Cook Islands'] = "ck"; 
    1541         $localestrings['Costa Rica'] = "cr"; 
    1542         $localestrings['Cote D\'Ivoire'] = "ci"; 
    1543         $localestrings['Country unknown'] = "--"; 
    1544         $localestrings['Croatia'] = "hr"; 
    1545         $localestrings['Cuba'] = "cu"; 
    1546         $localestrings['Cyprus'] = "cy"; 
    1547         $localestrings['Czech Republic'] = "cz"; 
    1548         $localestrings['Democratic People\'s Repub'] = "kp"; 
    1549         $localestrings['Denmark'] = "dk"; 
    1550         $localestrings['Djibouti'] = "dj"; 
    1551         $localestrings['Dominica'] = "dm"; 
    1552         $localestrings['Dominican Republic'] = "do"; 
     1510        $localestrings['azerbaijan'] = "az"; 
     1511        $localestrings['bahamas'] = "bs"; 
     1512        $localestrings['bahrain'] = "bh"; 
     1513        $localestrings['bangladesh'] = "bd"; 
     1514        $localestrings['barbados'] = "bb"; 
     1515        $localestrings['belarus'] = "by"; 
     1516        $localestrings['belgium'] = "be"; 
     1517        $localestrings['belize'] = "bz"; 
     1518        $localestrings['benin'] = "bj"; 
     1519        $localestrings['bermuda'] = "bm"; 
     1520        $localestrings['bhutan'] = "bt"; 
     1521        $localestrings['bolivia'] = "bo"; 
     1522        $localestrings['bosnia and herzegovina'] = "ba"; 
     1523        $localestrings['bosnia herzegovina'] = "ba"; 
     1524        $localestrings['botswana'] = "bw"; 
     1525        $localestrings['bouvet island'] = "bv"; 
     1526        $localestrings['brazil'] = "br"; 
     1527        $localestrings['british indian ocean territories'] = "io"; 
     1528        $localestrings['british virgin islands'] = "vg"; 
     1529        $localestrings['brunei'] = "bn"; 
     1530        $localestrings['brunei darussalam'] = "bn"; 
     1531        $localestrings['bulgaria'] = "bg"; 
     1532        $localestrings['burkina faso'] = "bf"; 
     1533        $localestrings['burundi'] = "bi"; 
     1534        $localestrings['cambodia'] = "kh"; 
     1535        $localestrings['cameroon'] = "cm"; 
     1536        $localestrings['canada'] = "ca"; 
     1537        $localestrings['cape verde'] = "cv"; 
     1538        $localestrings['cayman islands'] = "ky"; 
     1539        $localestrings['central african republic'] = "cf"; 
     1540        $localestrings['chad'] = "td"; 
     1541        $localestrings['chile'] = "cl"; 
     1542        $localestrings['china'] = "cn"; 
     1543        $localestrings['christmas island'] = "cx"; 
     1544        $localestrings['cocos islands'] = "cc"; 
     1545        $localestrings['keeling islands'] = "cc"; 
     1546        $localestrings['cocos (keeling) islands'] = "cc"; 
     1547        $localestrings['colombia'] = "co"; 
     1548        $localestrings['comoros'] = "km"; 
     1549        $localestrings['congo'] = "cg"; 
     1550        $localestrings['cook islands'] = "ck"; 
     1551        $localestrings['costa rica'] = "cr"; 
     1552        $localestrings['cote d\'ivoire'] = "ci"; 
     1553        $localestrings['ivory coast'] = "ci"; 
     1554        $localestrings['country unknown'] = "--"; 
     1555        $localestrings['unknown'] = "--"; 
     1556        $localestrings['croatia'] = "hr"; 
     1557        $localestrings['cuba'] = "cu"; 
     1558        $localestrings['cyprus'] = "cy"; 
     1559        $localestrings['czech republic'] = "cz"; 
     1560        $localestrings['democratic people\'s republic of korea'] = "kp"; 
     1561        $localestrings['denmark'] = "dk"; 
     1562        $localestrings['djibouti'] = "dj"; 
     1563        $localestrings['dominica'] = "dm"; 
     1564        $localestrings['dominican republic'] = "do"; 
    15531565        $localestrings['dubai'] = "ae"; 
    15541566        $localestrings['dubai emirates'] = "ae"; 
    1555         $localestrings['Ecuador'] = "ec"; 
    1556         $localestrings['Egypt'] = "eg"; 
    1557         $localestrings['El Salvador'] = "sv"; 
     1567        $localestrings['ecuador'] = "ec"; 
     1568        $localestrings['egypt'] = "eg"; 
     1569        $localestrings['el salvador'] = "sv"; 
    15581570        $localestrings['equator'] = "ec"; 
    1559         $localestrings['Equatorial Guinea'] = "gq"; 
    1560         $localestrings['Eritrea'] = "er"; 
    1561         $localestrings['Estonia'] = "ee"; 
    1562         $localestrings['Ethiopia'] = "et"; 
    1563         $localestrings['Falkland Islands (Malvina'] = "fk"; 
    1564         $localestrings['Faroe Islands'] = "fo"; 
    1565         $localestrings['Federated States Of Micro'] = "fm"; 
    1566         $localestrings['Fiji'] = "fj"; 
    1567         $localestrings['Finland'] = "fi"; 
    1568         $localestrings['France'] = "fr"; 
    1569         $localestrings['French Guiana'] = "gf"; 
    1570         $localestrings['French Polynesia'] = "pf"; 
    1571         $localestrings['French Southern Territori'] = "tf"; 
    1572         $localestrings['Gabon'] = "ga"; 
    1573         $localestrings['Gambia'] = "gm"; 
    1574         $localestrings['Georgia'] = "ge"; 
    1575         $localestrings['Germany'] = "de"; 
    1576         $localestrings['Ghana'] = "gh"; 
    1577         $localestrings['Gibraltar'] = "gi"; 
    1578         $localestrings['Greece'] = "gr"; 
    1579         $localestrings['Greenland'] = "gl"; 
    1580         $localestrings['Grenada'] = "gd"; 
    1581         $localestrings['Guadeloupe'] = "gp"; 
    1582         $localestrings['Guam'] = "gu"; 
    1583         $localestrings['Guatemala'] = "gt"; 
    1584         $localestrings['Guernsey'] = "gg"; 
    1585         $localestrings['Guinea'] = "gn"; 
    1586         $localestrings['Guinea-Bissau'] = "gw"; 
    1587         $localestrings['Guyana'] = "gy"; 
    1588         $localestrings['Haiti'] = "ht"; 
    1589         $localestrings['Heard Island And Mcdonald'] = "hm"; 
    1590         $localestrings['Holy See (Vatican City St'] = "va"; 
    1591         $localestrings['Honduras'] = "hn"; 
    1592         $localestrings['Hong Kong'] = "hk"; 
    1593         $localestrings['Hungary'] = "hu"; 
    1594         $localestrings['Iceland'] = "is"; 
     1571        $localestrings['equatorial guinea'] = "gq"; 
     1572        $localestrings['eritrea'] = "er"; 
     1573        $localestrings['estonia'] = "ee"; 
     1574        $localestrings['ethiopia'] = "et"; 
     1575        $localestrings['falkland islands'] = "fk"; 
     1576        $localestrings['malvinas'] = "fk"; 
     1577        $localestrings['faroe islands'] = "fo"; 
     1578        $localestrings['federated states of micronesia'] = "fm"; 
     1579        $localestrings['fiji'] = "fj"; 
     1580        $localestrings['finland'] = "fi"; 
     1581        $localestrings['france'] = "fr"; 
     1582        $localestrings['french guiana'] = "gf"; 
     1583        $localestrings['french Polynesia'] = "pf"; 
     1584        $localestrings['french southern territories'] = "tf"; 
     1585        $localestrings['gabon'] = "ga"; 
     1586        $localestrings['gambia'] = "gm"; 
     1587        $localestrings['georgia'] = "ge"; 
     1588        $localestrings['germany'] = "de"; 
     1589        $localestrings['ghana'] = "gh"; 
     1590        $localestrings['gibraltar'] = "gi"; 
     1591        $localestrings['greece'] = "gr"; 
     1592        $localestrings['greenland'] = "gl"; 
     1593        $localestrings['grenada'] = "gd"; 
     1594        $localestrings['guadeloupe'] = "gp"; 
     1595        $localestrings['guam'] = "gu"; 
     1596        $localestrings['guatemala'] = "gt"; 
     1597        $localestrings['guernsey'] = "gg"; 
     1598        $localestrings['guinea'] = "gn"; 
     1599        $localestrings['guinea-Bissau'] = "gw"; 
     1600        $localestrings['guyana'] = "gy"; 
     1601        $localestrings['haiti'] = "ht"; 
     1602        $localestrings['heard island and mcdonald islands'] = "hm"; 
     1603        $localestrings['holy see'] = "va"; 
     1604        $localestrings['vatican'] = "va"; 
     1605        $localestrings['vatican city'] = "va"; 
     1606        $localestrings['honduras'] = "hn"; 
     1607        $localestrings['hong kong'] = "hk"; 
     1608        $localestrings['hungary'] = "hu"; 
     1609        $localestrings['iceland'] = "is"; 
    15951610        $localestrings['India'] = "in"; 
    15961611        $localestrings['Indonesia'] = "id"; 
    15971612        $localestrings['iran'] = "ir"; 
    1598         $localestrings['Iraq'] = "iq"; 
    1599         $localestrings['Ireland'] = "ie"; 
    1600         $localestrings['Islamic Republic Of Iran'] = "ir"; 
    1601         $localestrings['Isle Of Man'] = "im"; 
    1602         $localestrings['Israel'] = "il"; 
    1603         $localestrings['Italy'] = "it"; 
    1604         $localestrings['Jamaica'] = "jm"; 
    1605         $localestrings['Japan'] = "jp"; 
    1606         $localestrings['Jersey'] = "je"; 
    1607         $localestrings['Jordan'] = "jo"; 
     1613        $localestrings['iraq'] = "iq"; 
     1614        $localestrings['ireland'] = "ie"; 
     1615        $localestrings['islamic republic of iran'] = "ir"; 
     1616        $localestrings['isle of man'] = "im"; 
     1617        $localestrings['israel'] = "il"; 
     1618        $localestrings['italy'] = "it"; 
     1619        $localestrings['jamaica'] = "jm"; 
     1620        $localestrings['japan'] = "jp"; 
     1621        $localestrings['jersey'] = "je"; 
     1622        $localestrings['jordan'] = "jo"; 
    16081623        $localestrings['jordania'] = "jo"; 
    1609         $localestrings['Kazakhstan'] = "kz"; 
    1610         $localestrings['Kenya'] = "ke"; 
    1611         $localestrings['Kiribati'] = "ki"; 
    1612         $localestrings['Kurdistan'] = "ku"; 
    1613         $localestrings['Kuwait'] = "kw"; 
    1614         $localestrings['Kyrgyzstan'] = "kg"; 
    1615         $localestrings['Latvia'] = "lv"; 
    1616         $localestrings['Lebanon'] = "lb"; 
    1617         $localestrings['Lesotho'] = "ls"; 
    1618         $localestrings['Liberia'] = "lr"; 
     1624        $localestrings['kazakhstan'] = "kz"; 
     1625        $localestrings['kenya'] = "ke"; 
     1626        $localestrings['kiribati'] = "ki"; 
     1627        $localestrings['kurdistan'] = "ku"; 
     1628        $localestrings['kuwait'] = "kw"; 
     1629        $localestrings['kyrgyzstan'] = "kg"; 
     1630        $localestrings['latvia'] = "lv"; 
     1631        $localestrings['lebanon'] = "lb"; 
     1632        $localestrings['lesotho'] = "ls"; 
     1633        $localestrings['liberia'] = "lr"; 
    16191634        $localestrings['libya'] = "ly"; 
    1620         $localestrings['Libyan Arab Jamahiriya'] = "ly"; 
    1621         $localestrings['Liechtenstein'] = "li"; 
    1622         $localestrings['Lithuania'] = "lt"; 
    1623         $localestrings['Luxembourg'] = "lu"; 
    1624         $localestrings['Macedonia'] = "mk"; 
    1625         $localestrings['Madagascar'] = "mg"; 
    1626         $localestrings['Malawi'] = "mw"; 
    1627         $localestrings['Malaysia'] = "my"; 
    1628         $localestrings['Maldives'] = "mv"; 
    1629         $localestrings['Mali'] = "ml"; 
    1630         $localestrings['Malta'] = "mt"; 
    1631         $localestrings['Marshall Islands'] = "mh"; 
    1632         $localestrings['Martinique'] = "mq"; 
    1633         $localestrings['Mauritania'] = "mr"; 
    1634         $localestrings['Mauritius'] = "mu"; 
    1635         $localestrings['Mayotte'] = "yt"; 
     1635        $localestrings['libyan arab jamahiriya'] = "ly"; 
     1636        $localestrings['liechtenstein'] = "li"; 
     1637        $localestrings['lithuania'] = "lt"; 
     1638        $localestrings['luxembourg'] = "lu"; 
     1639        $localestrings['macedonia'] = "mk"; 
     1640        $localestrings['madagascar'] = "mg"; 
     1641        $localestrings['malawi'] = "mw"; 
     1642        $localestrings['malaysia'] = "my"; 
     1643        $localestrings['maldives'] = "mv"; 
     1644        $localestrings['mali'] = "ml"; 
     1645        $localestrings['malta'] = "mt"; 
     1646        $localestrings['marshall islands'] = "mh"; 
     1647        $localestrings['martinique'] = "mq"; 
     1648        $localestrings['mauritania'] = "mr"; 
     1649        $localestrings['mauritius'] = "mu"; 
     1650        $localestrings['mayotte'] = "yt"; 
    16361651        $localestrings['mesopotamia'] = "ku"; 
    1637         $localestrings['Mexico'] = "mx"; 
    1638         $localestrings['Monaco'] = "mc"; 
    1639         $localestrings['Mongolia'] = "mn"; 
     1652        $localestrings['mexico'] = "mx"; 
     1653        $localestrings['monaco'] = "mc"; 
     1654        $localestrings['mongolia'] = "mn"; 
    16401655        $localestrings['montenegro'] = "me"; 
    1641         $localestrings['Montserrat'] = "ms"; 
    1642         $localestrings['Morocco'] = "ma"; 
    1643         $localestrings['Mozambique'] = "mz"; 
    1644         $localestrings['Myanmar'] = "mm"; 
    1645         $localestrings['Namibia'] = "na"; 
    1646         $localestrings['Nauru'] = "nr"; 
    1647         $localestrings['Nepal'] = "np"; 
    1648         $localestrings['Netherlands Antilles'] = "an"; 
    1649         $localestrings['New Caledonia'] = "nc"; 
    1650         $localestrings['New Zealand'] = "nz"; 
    1651         $localestrings['Nicaragua'] = "ni"; 
    1652         $localestrings['Niger'] = "ne"; 
    1653         $localestrings['Nigeria'] = "ng"; 
    1654         $localestrings['Niue'] = "nu"; 
    1655         $localestrings['Norfolk Island'] = "nf"; 
    1656         $localestrings['Northern Mariana Islands'] = "mp"; 
    1657         $localestrings['Norway'] = "no"; 
    1658         $localestrings['Oman'] = "om"; 
    1659         $localestrings['Pakistan'] = "pk"; 
    1660         $localestrings['Palau'] = "pw"; 
    1661         $localestrings['Panama'] = "pa"; 
    1662         $localestrings['Papua New Guinea'] = "pg"; 
    1663         $localestrings['Paraguay'] = "py"; 
    1664         $localestrings['Peru'] = "pe"; 
    1665         $localestrings['Philippines'] = "ph"; 
    1666         $localestrings['Poland'] = "pl"; 
    1667         $localestrings['Portugal'] = "pt"; 
    1668         $localestrings['Puerto Rico'] = "pr"; 
    1669         $localestrings['Qatar'] = "qa"; 
    1670         $localestrings['Republic Of Korea'] = "kr"; 
    1671         $localestrings['Republic Of Moldova'] = "md"; 
    1672         $localestrings['Romania'] = "ro"; 
     1656        $localestrings['montserrat'] = "ms"; 
     1657        $localestrings['morocco'] = "ma"; 
     1658        $localestrings['mozambique'] = "mz"; 
     1659        $localestrings['myanmar'] = "mm"; 
     1660        $localestrings['namibia'] = "na"; 
     1661        $localestrings['nauru'] = "nr"; 
     1662        $localestrings['nepal'] = "np"; 
     1663        $localestrings['netherlands antilles'] = "an"; 
     1664        $localestrings['new caledonia'] = "nc"; 
     1665        $localestrings['new zealand'] = "nz"; 
     1666        $localestrings['nicaragua'] = "ni"; 
     1667        $localestrings['niger'] = "ne"; 
     1668        $localestrings['nigeria'] = "ng"; 
     1669        $localestrings['niue'] = "nu"; 
     1670        $localestrings['norfolk island'] = "nf"; 
     1671        $localestrings['northern mariana islands'] = "mp"; 
     1672        $localestrings['norway'] = "no"; 
     1673        $localestrings['oman'] = "om"; 
     1674        $localestrings['pakistan'] = "pk"; 
     1675        $localestrings['palau'] = "pw"; 
     1676        $localestrings['panama'] = "pa"; 
     1677        $localestrings['papua new guinea'] = "pg"; 
     1678        $localestrings['paraguay'] = "py"; 
     1679        $localestrings['peru'] = "pe"; 
     1680        $localestrings['philippines'] = "ph"; 
     1681        $localestrings['poland'] = "pl"; 
     1682        $localestrings['portugal'] = "pt"; 
     1683        $localestrings['puerto Rico'] = "pr"; 
     1684        $localestrings['palestinian Territories'] = "ps"; 
     1685        $localestrings['qatar'] = "qa"; 
     1686        $localestrings['republic Of korea'] = "kr"; 
     1687        $localestrings['republic Of moldova'] = "md"; 
     1688        $localestrings['romania'] = "ro"; 
    16731689        $localestrings['russia'] = "ru"; 
    1674         $localestrings['Russian Federation'] = "ru"; 
    1675         $localestrings['Rwanda'] = "rw"; 
    1676         $localestrings['Saint Helena'] = "sh"; 
    1677         $localestrings['Saint Kitts And Nevis'] = "kn"; 
    1678         $localestrings['Saint Lucia'] = "lc"; 
    1679         $localestrings['Saint Pierre And Miquelon'] = "pm"; 
    1680         $localestrings['Saint Vincent And The Gre'] = "vc"; 
    1681         $localestrings['Samoa'] = "ws"; 
    1682         $localestrings['San Marino'] = "sm"; 
    1683         $localestrings['Saudi Arabia'] = "sa"; 
    1684         $localestrings['Senegal'] = "sn"; 
     1690        $localestrings['russian federation'] = "ru"; 
     1691        $localestrings['rwanda'] = "rw"; 
     1692        $localestrings['saint helena'] = "sh"; 
     1693        $localestrings['saint kitts and nevis'] = "kn"; 
     1694        $localestrings['saint lucia'] = "lc"; 
     1695        $localestrings['saint pierre and miquelon'] = "pm"; 
     1696        $localestrings['saint vincent and the grenadines'] = "vc"; 
     1697        $localestrings['samoa'] = "ws"; 
     1698        $localestrings['san marino'] = "sm"; 
     1699        $localestrings['saudi arabia'] = "sa"; 
     1700        $localestrings['senegal'] = "sn"; 
    16851701        $localestrings['serbia'] = "rs"; 
    1686         $localestrings['Serbia And Montenegro'] = "cs"; 
    1687         $localestrings['Seychelles'] = "sc"; 
     1702        $localestrings['serbia and montenegro'] = "cs"; 
     1703        $localestrings['seychelles'] = "sc"; 
    16881704        $localestrings['sharjah emirate'] = "ae"; 
    1689         $localestrings['Sierra Leone'] = "sl"; 
    1690         $localestrings['Singapore'] = "sg"; 
    1691         $localestrings['Slovakia'] = "sk"; 
    1692         $localestrings['Slovenia'] = "si"; 
    1693         $localestrings['Solomon Islands'] = "sb"; 
    1694         $localestrings['Somalia'] = "so"; 
    1695         $localestrings['South Africa'] = "za"; 
     1705        $localestrings['sierra leone'] = "sl"; 
     1706        $localestrings['singapore'] = "sg"; 
     1707        $localestrings['slovakia'] = "sk"; 
     1708        $localestrings['slovenia'] = "si"; 
     1709        $localestrings['solomon islands'] = "sb"; 
     1710        $localestrings['somalia'] = "so"; 
     1711        $localestrings['south africa'] = "za"; 
    16961712        $localestrings['south korea'] = "kr"; 
    1697         $localestrings['Spain'] = "es"; 
    1698         $localestrings['Sri Lanka'] = "lk"; 
    1699         $localestrings['Sudan'] = "sd"; 
    1700         $localestrings['Suriname'] = "sr"; 
    1701         $localestrings['Svalbard And Jan Mayen'] = "sj"; 
    1702         $localestrings['Swaziland'] = "sz"; 
    1703         $localestrings['Sweden'] = "se"; 
    1704         $localestrings['Switzerland'] = "ch"; 
     1713        $localestrings['spain'] = "es"; 
     1714        $localestrings['sri lanka'] = "lk"; 
     1715        $localestrings['sudan'] = "sd"; 
     1716        $localestrings['suriname'] = "sr"; 
     1717        $localestrings['svalbard and jan mayen'] = "sj"; 
     1718        $localestrings['swaziland'] = "sz"; 
     1719        $localestrings['sweden'] = "se"; 
     1720        $localestrings['switzerland'] = "ch"; 
    17051721        $localestrings['syria'] = "sy"; 
    1706         $localestrings['Syrian Arab Republic'] = "sy"; 
    1707         $localestrings['Taiwan, Province Of China'] = "tw"; 
    1708         $localestrings['Tajikistan'] = "tj"; 
    1709         $localestrings['Thailand'] = "th"; 
    1710         $localestrings['The Democratic Republic O'] = "cd"; 
    1711         $localestrings['The Netherlands'] = "nl"; 
    1712         $localestrings['Timor-Leste'] = "tl"; 
    1713         $localestrings['Togo'] = "tg"; 
    1714         $localestrings['Tokelau'] = "tk"; 
    1715         $localestrings['Tonga'] = "to"; 
    1716         $localestrings['Trinidad And Tobago'] = "tt"; 
    1717         $localestrings['Tunisia'] = "tn"; 
    1718         $localestrings['Turkey'] = "tr"; 
    1719         $localestrings['Turkmenistan'] = "tm"; 
    1720         $localestrings['Turks And Caicos Islands'] = "tc"; 
    1721         $localestrings['Tuvalu'] = "tv"; 
    1722         $localestrings['U.S. Virgin Islands'] = "vi"; 
     1722        $localestrings['syrian arab republic'] = "sy"; 
     1723        $localestrings['taiwan'] = "tw"; 
     1724        $localestrings['taiwan, province of china'] = "tw"; 
     1725        $localestrings['tajikistan'] = "tj"; 
     1726        $localestrings['thailand'] = "th"; 
     1727        $localestrings['the democratic republic of the congo'] = "cd"; 
     1728        $localestrings['congo'] = "cd"; 
     1729        $localestrings['the netherlands'] = "nl"; 
     1730        $localestrings['netherlands'] = "nl"; 
     1731        $localestrings['holland'] = "nl"; 
     1732        $localestrings['timor-leste'] = "tl"; 
     1733        $localestrings['togo'] = "tg"; 
     1734        $localestrings['tokelau'] = "tk"; 
     1735        $localestrings['tonga'] = "to"; 
     1736        $localestrings['trinidad and tobago'] = "tt"; 
     1737        $localestrings['tunisia'] = "tn"; 
     1738        $localestrings['turkey'] = "tr"; 
     1739        $localestrings['turkmenistan'] = "tm"; 
     1740        $localestrings['turks and caicos islands'] = "tc"; 
     1741        $localestrings['tuvalu'] = "tv"; 
     1742        $localestrings['u.s. virgin islands'] = "vi"; 
    17231743        $localestrings['u.s.a.'] = "us"; 
    1724         $localestrings['Uganda'] = "ug"; 
    1725         $localestrings['Ukraine'] = "ua"; 
     1744        $localestrings['united states'] = "us"; 
     1745        $localestrings['america'] = "us"; 
     1746        $localestrings['uganda'] = "ug"; 
     1747        $localestrings['ukraine'] = "ua"; 
    17261748        $localestrings['undefined'] = "--"; 
    1727         $localestrings['United Arab Emirates'] = "ae"; 
    1728         $localestrings['United Kingdom'] = "gb"; 
    1729         $localestrings['United States'] = "us"; 
    1730         $localestrings['United States Minor Outly'] = "um"; 
    1731         $localestrings['Unlisted country'] = "??"; 
    1732         $localestrings['Uruguay'] = "uy"; 
    1733         $localestrings['Uzbekistan'] = "uz"; 
    1734         $localestrings['Vanuatu'] = "vu"; 
    1735         $localestrings['Venezuela'] = "ve"; 
    1736         $localestrings['Viet Nam'] = "vn"; 
     1749        $localestrings['united arab emirates'] = "ae"; 
     1750        $localestrings['united kingdom'] = "gb"; 
     1751        $localestrings['great britain'] = "gb"; 
     1752        $localestrings['united states minor outlying islands'] = "um"; 
     1753        $localestrings['unlisted country'] = "--"; 
     1754        $localestrings['uruguay'] = "uy"; 
     1755        $localestrings['uzbekistan'] = "uz"; 
     1756        $localestrings['vanuatu'] = "vu"; 
     1757        $localestrings['venezuela'] = "ve"; 
     1758        $localestrings['viet nam'] = "vn"; 
    17371759        $localestrings['vietnam'] = "vn"; 
    1738         $localestrings['Wallis And Futuna'] = "wf"; 
    1739         $localestrings['Western Sahara'] = "eh"; 
    1740         $localestrings['Yemen'] = "ye"; 
    1741         $localestrings['Zambia'] = "zm"; 
    1742         $localestrings['Zimbabwe'] = "zw"; 
     1760        $localestrings['wallis and futuna'] = "wf"; 
     1761        $localestrings['western sahara'] = "eh"; 
     1762        $localestrings['yemen'] = "ye"; 
     1763        $localestrings['zambia'] = "zm"; 
     1764        $localestrings['zimbabwe'] = "zw"; 
    17431765        load_localestrings($localestrings, LP_LOCALE, "countryname", $step); 
    17441766 
     
    26422664        $localestrings['065'] = "Not a member yet?<br /><a href='%sregister.php' class='side'>Click here</a> to register."; 
    26432665        $localestrings['066'] = "Forgotten your password?<br />Request a new one <a href='%slostpassword.php' class='side'>here</a>."; 
     2666        $localestrings['067'] = "OpenID URL"; 
     2667        $localestrings['068'] = "Get an OpenID"; 
     2668        $localestrings['069'] = "Info"; 
    26442669        $localestrings['070'] = "Online"; 
    26452670        $localestrings['071'] = "< 5 mins"; 
     
    32633288        $localestrings['u064'] = "Female"; 
    32643289        $localestrings['u065'] = "Undisclosed"; 
     3290        $localestrings['u066'] = "OpenID URL:"; 
    32653291        $localestrings['u901'] = "Full Name"; 
    32663292        load_localestrings($localestrings, LP_LOCALE, "main.user_fields", $step); 
  • trunk/administration/tools/language_pack_Nederlands.php

    r1533 r1558  
    988988        $localestrings['535'] = "Uur"; 
    989989        $localestrings['536'] = "Uren"; 
     990        $localestrings['537'] = "Authenticatie methode:"; 
     991        $localestrings['538'] = "Lokale database"; 
     992        $localestrings['539'] = "LDAP Server"; 
     993        $localestrings['540'] = "Active Directory Server"; 
     994        $localestrings['541'] = ", daarna "; 
     995        $localestrings['542'] = ", met OpenID"; 
    990996        $localestrings['550'] = "Beveiliging"; 
    991997        $localestrings['551'] = "Activeer registratie systeem?"; 
     
    14211427        $localestrings['pm'] = "Sint Pierre en Miquelon"; 
    14221428        $localestrings['pr'] = "Puerto Rico"; 
     1429        $localestrings['ps'] = "Palestina"; 
    14231430        $localestrings['pt'] = "Portugal"; 
    14241431        $localestrings['pw'] = "Palau"; 
     
    16671674        $localestrings['Portugal'] = "pt"; 
    16681675        $localestrings['Puerto Rico'] = "pr"; 
     1676        $localestrings['Palestina'] = "ps"; 
    16691677        $localestrings['Qatar'] = "qa"; 
    16701678        $localestrings['Republic Of Korea'] = "kr"; 
     
    26422650        $localestrings['065'] = "Nog geen lid?<br /><a href='%sregister.php' class='side'>Klik hier</a> om te registeren."; 
    26432651        $localestrings['066'] = "Wachtwoord vergeten?<br />Vraag <a href='%slostpassword.php' class='side'>hier</a> een nieuwe aan."; 
     2652        $localestrings['067'] = "OpenID URL"; 
     2653        $localestrings['068'] = "OpenID aanmaken"; 
     2654        $localestrings['069'] = "Info"; 
    26442655        $localestrings['070'] = "Online"; 
    26452656        $localestrings['071'] = "< 5 mins"; 
     
    32633274        $localestrings['u064'] = "Vrouwlijk"; 
    32643275        $localestrings['u065'] = "Geen opgave"; 
     3276        $localestrings['u066'] = "OpenID URL:"; 
    32653277        $localestrings['u901'] = "Volledige naam"; 
    32663278        load_localestrings($localestrings, LP_LOCALE, "main.user_fields", $step); 
  • trunk/edit_profile.php

    r1520 r1558  
    127127    } 
    128128     
    129     $user_fullname = $_POST['user_fullname']; 
     129    $user_fullname = stripinput($_POST['user_fullname']); 
     130    $user_openid_url = isURL(stripinput($_POST['user_openid_url'])) ? stripinput($_POST['user_openid_url']) : ""; 
    130131    $user_hide_email = isNum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1"; 
    131132    $user_location = isset($_POST['user_location']) ? stripinput(trim($_POST['user_location'])) : ""; 
     
    187188        } 
    188189        if ($user_newpassword != "") { $newpass = " user_password=md5(md5('$user_newpassword')), "; } else { $newpass = " "; } 
    189         $result = dbquery("UPDATE ".$db_prefix."users SET user_name='$username', user_fullname='$user_fullname', ".$newpass."user_email='".$_POST['user_email']."', user_bad_email = '0', user_hide_email='$user_hide_email', user_location='$user_location', user_birthdate='$user_birthdate', user_gender='$user_gender', user_aim='$user_aim', user_icq='$user_icq', user_msn='$user_msn', user_yahoo='$user_yahoo', user_web='$user_web', user_forum_fullscreen='$user_forum_fullscreen', user_posts_unread='$user_posts_unread', user_newsletters='$user_newsletters', user_theme='$user_theme', user_offset='$user_offset', ".$set_avatar."user_sig='$user_sig', user_locale='".$_POST['user_locale']."' WHERE user_id='".$this_userdata['user_id']."'"); 
     190        $result = dbquery("UPDATE ".$db_prefix."users SET user_name='$username', user_fullname='$user_fullname', ".$newpass."user_email='".$_POST['user_email']."', user_bad_email = '0', user_hide_email='$user_hide_email', user_location='$user_location', user_birthdate='$user_birthdate', user_gender='$user_gender', user_aim='$user_aim', user_icq='$user_icq', user_msn='$user_msn', user_yahoo='$user_yahoo', user_web='$user_web', user_forum_fullscreen='$user_forum_fullscreen', user_posts_unread='$user_posts_unread', user_newsletters='$user_newsletters', user_theme='$user_theme', user_offset='$user_offset', ".$set_avatar."user_sig='$user_sig', user_locale='".$_POST['user_locale']."', user_openid_url='$user_openid_url' WHERE user_id='".$this_userdata['user_id']."'"); 
    190191        if ($user_theme != $userdata['user_theme']) redirect(FUSION_SELF."?status=1"); 
    191192        $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='".$this_userdata['user_id']."'"); 
     
    251252} 
    252253 
     254// check which authentication to show 
     255$auth_methods = explode(",",$settings['auth_type'].","); 
     256switch($auth_methods[0]) { 
     257    case "local": 
     258    case "ldap": 
     259    case "ad": 
     260        $variables['auth_userpass'] = 1; 
     261        break; 
     262    default: 
     263        $variables['auth_userpass'] = 0; 
     264} 
     265switch($auth_methods[0]) { 
     266    case "openid": 
     267        $variables['auth_openid'] = 1; 
     268        break; 
     269    default: 
     270        $variables['auth_openid'] = 0; 
     271} 
     272switch($auth_methods[1]) { 
     273    case "local": 
     274        $variables['auth_userpass'] = 1; 
     275        break; 
     276    default: 
     277        break; 
     278} 
     279 
    253280// define the search body panel variables 
    254281$template_panels[] = array('type' => 'body', 'name' => 'edit_profile', 'template' => 'main.edit_profile.tpl', 'locale' => array("main.members-profile", "main.user_fields")); 
  • trunk/files/locales/en.main.global.php

    r1542 r1558  
    33// locale       : English 
    44// locale name  : main.global 
    5 // generated on : Tue Jul 8 2008, 20:58:11 CEST 
     5// generated on : Wed Jul 30 2008, 0:23:10 CEST 
    66// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
     
    6666$locale['065'] = "Not a member yet?<br /><a href='%sregister.php' class='side'>Click here</a> to register."; 
    6767$locale['066'] = "Forgotten your password?<br />Request a new one <a href='%slostpassword.php' class='side'>here</a>."; 
     68$locale['067'] = "OpenID URL"; 
     69$locale['068'] = "Get an OpenID"; 
     70$locale['069'] = "Info"; 
    6871$locale['070'] = "Online"; 
    6972$locale['071'] = "< 5 mins"; 
  • trunk/includes/core_functions.php

    r1550 r1558  
    265265    if ($type == "header") { 
    266266        header("Location: ".$location); 
    267         die(); 
    268267    } else { 
    269268        echo "<script type='text/javascript'>document.location.href='".$location."'</script>\n"; 
    270269        echo sprintf($locale['182'], $location); 
    271270    } 
     271    exit; 
    272272} 
    273273 
  • trunk/includes/templates/admin.settings_security.tpl

    r1341 r1558  
    8888        <tr> 
    8989            <td width='50%' class='tbl'> 
     90                {$locale.537} 
     91            </td> 
     92            <td width='50%' class='tbl'> 
     93                <select name='auth_method' class='textbox'> 
     94                    <option value='0'{if $auth_method == "0"} selected="selected"{/if}>{$locale.538}</option> 
     95                    <option value='1'{if $auth_method == "1"} selected="selected"{/if}>{$locale.539}</option> 
     96                    <option value='1+'{if $auth_method == "1+"} selected="selected"{/if}>{$locale.539}{$locale.541}{$locale.538}</option> 
     97                    <option value='2'{if $auth_method == "2"} selected="selected"{/if}>{$locale.540}</option> 
     98                    <option value='2+'{if $auth_method == "2+"} selected="selected"{/if}>{$locale.540}{$locale.541}{$locale.538}</option> 
     99                    <option value='3+'{if $auth_method == "3+"} selected="selected"{/if}>{$locale.538}{$locale.542}</option> 
     100                </select> 
     101            </td> 
     102        </tr> 
     103        <tr> 
     104            <td align='center' colspan='2' class='tbl'> 
     105                <hr /> 
     106            </td> 
     107        </tr> 
     108        <tr> 
     109            <td width='50%' class='tbl'> 
    90110                {$locale.528} 
    91111            </td> 
  • trunk/includes/templates/main.edit_profile.tpl

    r1520 r1558  
    3737            {/if} 
    3838        {/if} 
     39        {if $auth_userpass} 
    3940        <tr> 
    4041            <td class='tbl'> 
     
    4546            </td> 
    4647        </tr> 
     48        {/if} 
    4749        <tr> 
    4850            <td class='tbl'> 
     
    5355            </td> 
    5456        </tr> 
     57        {if $auth_userpass} 
    5558        <tr> 
    5659            <td class='tbl'> 
     
    6871            </td> 
    6972        </tr> 
     73        {/if} 
     74        {if $auth_openid} 
     75        <tr> 
     76            <td class='tbl'> 
     77                {$locale.u066}</td> 
     78            <td class='tbl'> 
     79                <input type='text' name='user_openid_url' value='{$this_userdata.user_openid_url}' maxlength='200' class='textbox' style='width:275px;background: url({$smarty.const.IMAGES}openid_small_logo.png) no-repeat; padding-left: 18px;' /> 
     80            </td> 
     81        </tr> 
     82        {/if} 
    7083        <tr> 
    7184            <td class='tbl'> 
  • trunk/includes/user_functions.php

    r1552 r1558  
    1515if (eregi("user_functions.php", $_SERVER['PHP_SELF']) || !defined('INIT_CMS_OK')) die(); 
    1616 
    17 // need to GeoIP functions to determine the users country of origin 
     17// need the GeoIP functions to determine the users country of origin 
    1818require_once "geoip_include.php"; 
    1919 
     
    4040// Set the users site_visited cookie if this is the first visit, and update the unique visit counter 
    4141// save the random site_visited value, we need that later in session management! 
    42 if (!CMS_IS_BOT && !isset($_COOKIE['site_visited'])) { 
    43     $result=dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = cfg_value+1 WHERE cfg_name = 'counter'"); 
    44     $site_visited = md5(uniqid(rand(), true)); 
    45     setcookie("site_visited", $site_visited, time() + 31536000, "/", "", "0"); 
    46 } else { 
    47     // replace the pre v7.1 cookie if needed 
    48     if ($_COOKIE['site_visited'] == "yes") { 
     42if (!CMS_IS_BOT) { 
     43    if (!isset($_COOKIE['site_visited'])) { 
     44        $result=dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = cfg_value+1 WHERE cfg_name = 'counter'"); 
    4945        $site_visited = md5(uniqid(rand(), true)); 
    5046        setcookie("site_visited", $site_visited, time() + 31536000, "/", "", "0"); 
    5147    } else { 
    52         $site_visited = $_COOKIE['site_visited']; 
    53     } 
    54 } 
    55  
    56 // Login code  
    57 if (isset($_POST['login']) && isset($_POST['user_name']) && isset($_POST['user_pass'])) { 
    58     $user_pass = md5(md5($_POST['user_pass'])); 
    59     $user_name = preg_replace(array("/\=/","/\#/","/\sOR\s/"), "", stripinput($_POST['user_name'])); 
    60     $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_name='$user_name' AND user_password='".$user_pass."'"); 
    61     if (dbrows($result) != 0) { 
    62         $data = dbarray($result); 
    63         // if the account is suspended, check for an expiry date 
    64         if ($data['user_status'] == 1 && $data['user_ban_expire'] > 0 && $data['user_ban_expire'] < time() ) { 
    65             // if this user's email address is marked as bad, reset the countdown counter 
    66             $data['user_bad_email'] = $data['user_bad_email'] == 0 ? 0 : time(); 
    67             // reset the user status and the expiry date 
    68             $result = dbquery("UPDATE ".$db_prefix."users SET user_status='0', user_ban_expire='0', user_bad_email = '".$data['user_bad_email']."' WHERE user_id='".$data['user_id']."'"); 
    69             $data['user_status'] = 0; 
    70         } 
    71         if ($data['user_status'] == 0) {     
    72             header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'"); 
    73             // set the 'remember me' status value  
    74             $_SESSION['remember_me'] = isset($_POST['remember_me']) ? "yes" : "no"; 
    75             $_SESSION['userinfo'] = $data['user_id'].".".$user_pass; 
    76             // login expiry defined? 
    77             if ($settings['login_expire']) { 
    78                 if (isset($_POST['remember_me']) && $_POST['remember_me'] == "yes") { 
    79                     $_SESSION['login_expire'] = time() + $settings['login_extended_expire']; 
    80                 } else { 
    81                     $_SESSION['login_expire'] = time() + $settings['login_expire']; 
     48        // replace the pre v7.1 cookie if needed 
     49        if ($_COOKIE['site_visited'] == "yes") { 
     50            $site_visited = md5(uniqid(rand(), true)); 
     51            setcookie("site_visited", $site_visited, time() + 31536000, "/", "", "0"); 
     52        } else { 
     53            $site_visited = $_COOKIE['site_visited']; 
     54        } 
     55    } 
     56} 
     57 
     58// Check if a user is logging in 
     59if (isset($_POST['login'])) { 
     60    $auth_result = false; 
     61    $auth_methods = explode(",",$settings['auth_type'].","); 
     62    foreach($auth_methods as $auth_method) { 
     63        switch($auth_method) { 
     64            case "local": 
     65                // authentication against the local user database 
     66                if (!empty($_POST['user_name']) && !empty($_POST['user_pass'])) { 
     67                    $auth_result = auth_local($_POST['user_name'], $_POST['user_pass']); 
    8268                } 
    83             } else { 
    84                 $_SESSION['login_expire'] = mktime(0,0,0,1,1,2038); // do not expire 
    85             } 
    86             redirect(BASEDIR."setuser.php?user=".$data['user_name'], "script"); 
    87             exit; 
    88         } elseif ($data['user_status'] == 1) { 
    89             redirect(BASEDIR."setuser.php?user_id=".$data['user_id']."&error=1", "script"); 
    90             exit; 
    91         } elseif ($data['user_status'] == 2) { 
    92             redirect(BASEDIR."setuser.php?error=2", "script"); 
    93             exit; 
    94         } 
    95     } else { 
    96         redirect(BASEDIR."setuser.php?error=3", "script"); 
    97         exit; 
     69                break; 
     70            case "ldap": 
     71                break; 
     72            case "ad": 
     73                break; 
     74            case "openid": 
     75                // authentication against an openid provider 
     76                if (!empty($_POST['user_openid_url'])) { 
     77                    $auth_result = auth_openid($_POST['user_openid_url']); 
     78                } 
     79                break; 
     80            case "default": 
     81                // empty or unknown entry, ignore 
     82                break; 
     83        } 
     84    } 
     85    // check the result of the authentication attempt, and process it 
     86    if (is_array($auth_result)) { 
     87        switch($auth_result[0]) { 
     88            case "redirect": 
     89                redirect($auth_result[1], $auth_result[2]); 
     90                exit;  
     91            default: 
     92                // unknown result code 
     93                _debug($auth_result); 
     94                terminate("unknown result code from an authentication module!"); 
     95        } 
    9896    } 
    9997} 
     
    226224} 
    227225 
     226// update the last users online information for guests 
     227if (iGUEST) { 
     228    $result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'"); 
     229    if (dbrows($result) != 0) { 
     230        $result = dbquery("UPDATE ".$db_prefix."online SET online_lastactive='".time()."' WHERE online_user='0' AND online_ip='".USER_IP."'"); 
     231    } else { 
     232        $result = dbquery("INSERT INTO ".$db_prefix."online (online_user, online_ip, online_lastactive) VALUES ('0', '".USER_IP."', '".time()."')"); 
     233    } 
     234} 
     235// update the last users online information for members 
     236if (iMEMBER) { 
     237    $result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user='".$userdata['user_id']."'"); 
     238    if (dbrows($result) != 0) { 
     239        $result = dbquery("UPDATE ".$db_prefix."online SET online_lastactive='".time()."' WHERE online_user='0' AND online_ip='".USER_IP."'"); 
     240    } else { 
     241        $result = dbquery("INSERT INTO ".$db_prefix."online (online_user, online_ip, online_lastactive) VALUES ('".$userdata['user_id']."', '".USER_IP."', '".time()."')"); 
     242    } 
     243} 
     244// users inactive for more than 180 seconds are not considered to be online 
     245$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_lastactive<".(time()-180).""); 
     246 
    228247// update the threads_read table for the current user 
    229248if (iMEMBER) { 
     
    241260    define("iAUTH", substr(md5($userdata['user_password']),16,32)); 
    242261    $aidlink = "?aid=".iAUTH; 
     262} 
     263 
     264/*---------------------------------------------------+ 
     265| User authentication functions                      | 
     266+----------------------------------------------------*/ 
     267 
     268// authentication against the local user database 
     269function auth_local($userid, $password) { 
     270    global $db_prefix; 
     271     
     272    // check and validate the given userid and pasword 
     273    $user_pass = md5(md5($password)); 
     274    $user_name = preg_replace(array("/\=/","/\#/","/\sOR\s/"), "", stripinput($userid)); 
     275 
     276    // check if we have a user record for this userid and password 
     277    $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_name='$user_name' AND user_password='".$user_pass."'"); 
     278    if (dbrows($result) == 0) { 
     279        // not found, display an error message 
     280        return array("redirect", BASEDIR."setuser.php?error=3", "script"); 
     281    } else { 
     282        // found, get the record and do some more validation 
     283        $ret = auth_user_validate(dbarray($result)); 
     284        return $ret; 
     285    } 
     286} 
     287 
     288// authentication against an LDAP server 
     289function auth_ldap($userid, $password) { 
     290    return array('auth_ldap not defined yet!'); 
     291} 
     292 
     293// authentication against an Active Directory server 
     294function auth_ad($userid, $password) { 
     295    return array('auth_ad not defined yet!'); 
     296} 
     297 
     298// authentication using an OpenID 
     299function auth_openid($openid_url) { 
     300    global $settings; 
     301 
     302    // check if the URL is valid 
     303    if (isURL($openid_url)) { 
     304        require_once(PATH_INCLUDES."class.openid.php"); 
     305        $openid = new SimpleOpenID; 
     306        $openid->SetIdentity($openid_url); 
     307        $openid->SetApprovedURL($settings['siteurl']."setuser.php"); 
     308        $openid->SetTrustRoot($settings['siteurl']); 
     309        $server_url = $openid->GetOpenIDServer(); 
     310        if ($server_url) { 
     311            return array("redirect", $openid->GetRedirectURL() , "script"); 
     312        } 
     313    } else { 
     314        // for now... 
     315        return false; 
     316    } 
     317} 
     318 
     319// further validation on the userid found 
     320function auth_user_validate($userrecord) { 
     321 
     322    // if the account is suspended, check for an expiry date 
     323    if ($userrecord['user_status'] == 1 && $userrecord['user_ban_expire'] > 0 && $userrecord['user_ban_expire'] < time() ) { 
     324        // if this user's email address is marked as bad, reset the countdown counter 
     325        $userrecord['user_bad_email'] = $userrecord['user_bad_email'] == 0 ? 0 : time(); 
     326        // reset the user status and the expiry date 
     327        $result = dbquery("UPDATE ".$db_prefix."users SET user_status='0', user_ban_expire='0', user_bad_email = '".$userrecord['user_bad_email']."' WHERE user_id='".$userrecord['user_id']."'"); 
     328        $userrecord['user_status'] = 0; 
     329    } 
     330    if ($userrecord['user_status'] == 0) {   
     331        header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'"); 
     332        // set the 'remember me' status value  
     333        $_SESSION['remember_me'] = isset($_POST['remember_me']) ? "yes" : "no"; 
     334        $_SESSION['userinfo'] = $userrecord['user_id'].".".$userrecord['user_password']; 
     335        // login expiry defined? 
     336        if ($settings['login_expire']) { 
     337            if (isset($_POST['remember_me']) && $_POST['remember_me'] == "yes") { 
     338                $_SESSION['login_expire'] = time() + $settings['login_extended_expire']; 
     339            } else { 
     340                $_SESSION['login_expire'] = time() + $settings['login_expire']; 
     341            } 
     342        } else { 
     343            $_SESSION['login_expire'] = mktime(0,0,0,1,1,2038); // do not expire 
     344        } 
     345        return array("redirect", BASEDIR."setuser.php?user=".$userrecord['user_name'], "script"); 
     346    } elseif ($userrecord['user_status'] == 1) { 
     347        return array("redirect", BASEDIR."setuser.php?user_id=".$userrecord['user_id']."&error=1", "script"); 
     348    } elseif ($userrecord['user_status'] == 2) { 
     349        return array("redirect", BASEDIR."setuser.php?error=2", "script"); 
     350    } 
    243351} 
    244352 
  • trunk/modules/user_info_panel/templates/modules.user_info_panel.tpl

    r1402 r1558  
    6060        {$loginerror|default:""} 
    6161        <form name='loginform' method='post' action='{$smarty.const.FUSION_SELF}'> 
    62             {$locale.061}<br /><input type='text' name='user_name' class='textbox' style='width:100px' /><br /> 
    63             {$locale.062}<br /><input type='password' name='user_pass' class='textbox' style='width:100px' /><br /> 
    64             <br /><input type='checkbox' name='remember_me' value='yes' title='{$locale.063}' style='vertical-align:middle;'{if $remember_me|default:"no" == "yes"} checked="checked"{/if}/> 
    65             <input type='submit' name='login' value='{$locale.064}' class='button' /><br /> 
     62            {if $auth_userpass} 
     63                {$locale.061}<br /><input type='text' name='user_name' class='textbox' style='width:125px' /><br /> 
     64                {$locale.062}<br /><input type='password' name='user_pass' class='textbox' style='width:125px' /><br /> 
     65            {/if} 
     66            {if $auth_openid} 
     67                {$locale.067}<br /><input type='text' name='user_openid_url' class='textbox' style='width:108px;background: url({$smarty.const.IMAGES}openid_small_logo.png) no-repeat; padding-left: 18px;' /><br /> 
     68                <span class='small' style='font-size:90%;'>  <a href="http://openid.net/get/"  target="_blank">{$locale.068}</a> &middot; <a href="http://openid.net/what" target="_blank">{$locale.069}</a></span><br /> 
     69            {/if} 
     70            <br /> 
     71            <input type='submit' name='login' value='{$locale.064}' class='button' /> 
     72            <input type='checkbox' name='remember_me' value='yes' title='{$locale.063}' style='vertical-align:middle;'{if $remember_me|default:"no" == "yes"} checked="checked"{/if}/><br /> 
    6673            <input type='hidden' name='javascript_check' value='n' /> 
    6774        </form> 
    6875    </div> 
    69     {literal} 
     76{literal} 
    7077<script type='text/javascript'> 
    7178/* <![CDATA[ */ 
     
    7683    /* ]]> */ 
    7784</script> 
    78     {/literal} 
    79     <br /> 
    80     {if $settings.enable_registration}{$settings.siteurl|string_format:$locale.065}<br /><br />{/if} 
    81     {$settings.siteurl|string_format:$locale.066} 
     85{/literal} 
     86    {if $show_reglink || $show_passlink} 
     87        <hr /> 
     88    {/if} 
     89    {if $show_reglink}{$settings.siteurl|string_format:$locale.065}<br /><br />{/if} 
     90    {if $show_passlink}{$settings.siteurl|string_format:$locale.066}{/if} 
    8291{/if} 
    8392{if $smarty.const.iMEMBER|default:false} 
  • trunk/modules/user_info_panel/user_info_panel.php

    r1542 r1558  
    6969$variables['login_expiry']  = (iADMIN && isset($_SESSION['login_expire'])) ? time_system2local($_SESSION['login_expire']) : ""; 
    7070 
     71// check which authentication to show 
     72$auth_methods = explode(",",$settings['auth_type'].","); 
     73switch($auth_methods[0]) { 
     74    case "local": 
     75    case "ldap": 
     76    case "ad": 
     77        $variables['auth_userpass'] = 1; 
     78        break; 
     79    default: 
     80        $variables['auth_userpass'] = 0; 
     81} 
     82switch($auth_methods[0]) { 
     83    case "openid": 
     84        $variables['auth_openid'] = 1; 
     85        break; 
     86    default: 
     87        $variables['auth_openid'] = 0; 
     88} 
     89switch($auth_methods[1]) { 
     90    case "local": 
     91        $variables['auth_userpass'] = 1; 
     92        break; 
     93    default: 
     94        break; 
     95} 
     96 
     97// check if we need to display links 
     98$variables['show_reglink'] = $settings['enable_registration']; 
     99$variables['show_passlink'] = 1; 
     100 
    71101$template_variables['modules.user_info_panel'] = $variables; 
    72102?> 
  • trunk/setuser.php

    r1454 r1558  
    1515require_once dirname(__FILE__)."/includes/core_functions.php"; 
    1616require_once dirname(__FILE__)."/includes/theme_functions.php"; 
    17  
    1817// temp storage for template variables 
    1918$variables = array(); 
     
    5756        $message['line2'] =  "<b>".$locale['196']."</b>"; 
    5857    } else { 
     58        if (isset($_GET['openid_mode'])) { 
     59            // handle openid login 
     60            require_once(PATH_INCLUDES."class.openid.php"); 
     61            $openid = new SimpleOpenID; 
     62            $openid->SetIdentity(urldecode($_GET['openid_identity'])); 
     63            if ($openid->ValidateWithServer()) { 
     64                $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_openid_url='".strtolower($_GET['openid_identity'])."'"); 
     65                if (dbrows($result) != 0) { 
     66                    // found, get the record and do some more validation 
     67                    $res = auth_user_validate(dbarray($result)); 
     68                    if (!is_array($res)) { 
     69                        die('invalid res'); 
     70                    } 
     71                } else { 
     72                    die('user not found'); 
     73                } 
     74            } else { 
     75                _debug($openid->GetError(), true); 
     76            } 
     77        } 
    5978        if (isset($_SESSION['userinfo'])) { 
     79            // handle local login 
    6080            $userinfo_vars = explode(".", $_SESSION['userinfo']); 
    6181            $user_pass = (preg_match("/^[0-9a-z]{32}$/", $userinfo_vars['1']) ? $userinfo_vars['1'] : ""); 
     
    6787                } 
    6888                $result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'"); 
    69                 $message['line2'] =  "<b>".$locale['193'].$user."</b>"; 
     89                $message['line2'] =  "<b>".$locale['193'].$data['user_name']."</b>"; 
    7090            } else { 
    7191                $message['line2'] =  "<b>".$locale['196']."</b>"; 
Note: See TracChangeset for help on using the changeset viewer.