Homepage | Products | OX Knowledge Base | Support | Try Now | Contact | Company
OX Logo
Results 1 to 5 of 5
  1. #1

    Default Return Code Password Änderung

    Hi,
    ich hab ein Script geschrieben, was die Kennwortänderung für unsere Umgebung aus dem OX heraus ermöglicht. (Samba, ldap). gleichzeitig prüft das Script, ob das neu eingegebene Kennwort bestimmten Richtlinien entspricht.

    Ich würde gern wissen, welche Return-Codes die GUI kennt, die ich bei Fehlern zurückgeben kann. Die 0 als "erfolgreich geändert", kennt die GUI ja :-)

    Gibt es da irgendwo eine Liste?

    Danke
    Sebbel

  2. #2

    Default

    Alternativ würde ich gerne die passwort-Ändern-Seite anpassen, dass da die Kennwortrichtlinien drin stehen, dann weiß der Nutzer wenigstens, warum eine Fehlermeldung kommt.
    Ist das möglich?

  3. #3
    Join Date
    Feb 2007
    Posts
    41

    Default

    Hi,

    please use exit code 1 instead of 0 as described in the config file: change_pwd_script.properties

    # Script which updates the users passwd
    # Must be executable (+x) and correct interpreter set (#!/bin/bash)
    #
    # Following values are passed by the servlet to the script:
    #
    # 1. --cid - Context ID
    # 2. --username - Username of the logged in user
    # 3. --userid - User ID of the logged in user
    # 4. --oldpassword - Old user password
    # 5. --newpassword - New user password
    #
    # If script does not exit with status code 0 , an error is shown in the GUI.
    #
    #
    com.openexchange.passwordchange.script.shellscript =/bin/changepwd.sh

  4. #4

    Default

    ok, but thats the same useless error-message: Fehlermeldung: es trat ein E/A-Fehler auf (SRV-0002, -6738123123-73831)

    Is it possible to give the user a meaningful error-message what's going wrong?
    thx

  5. #5

    Default

    OK, i have found a solution.
    I have modified the javascript "register.js" at plugins/com.openexchange.user.passwordchange. The password-Validation is now directly at the gui. Only thing i have to to now is to modifiy the translation files to get localised error messages.

    Maybe you can implement the code in ox in the next version or something like that?

    Here the complete code:
    /*
    * All content on this website (including text, images, source
    * code and any other original works), unless otherwise noted,
    * is licensed under a Creative Commons License.
    *
    * http://creativecommons.org/licenses/by-nc-sa/2.5/
    *
    * Copyright (C) 2004-2010 Open-Xchange, Inc.
    * Mail: info@open-xchange.com
    */

    // following parameter enables checks, valid values are true/false
    var check_length = false
    var check_lowercase = true
    var check_uppercase = true
    var check_number = true

    // configure password-checks
    var minLength = "8"
    var lowercases = "abcdefghijklmnopqrstuvwxyz"
    var uppercases = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    var numbers = "1234567890"

    new ox.Configuration.InnerNode("configuration/user", _("User"));

    var node = new ox.Configuration.LeafNode("configuration/user/password",
    _("Password"));
    var page = new ox.Configuration.Page(node, _("Change Password"));

    var intro = new ox.UI.Text(_("Choose a new password for your account."));
    page.addWidget(intro);

    var pass_old = new ox.UI.Password(_("Your old password"));
    page.addWidget(pass_old, "old_password");

    var pass_new = new ox.UI.Password(_("The new password"));
    page.addWidget(pass_new, "new_password");

    var pass_new2 = new ox.UI.Password(_("Confirm new password"));
    page.addWidget(pass_new2, "new_password2");

    page.save = function (data, cont) {
    function emptyPass() {
    ox.Configuration.error(_("Please enter your old password and twice the new password."));
    }
    if (pass_old.get() == "") {
    pass_old.formnode.focus();
    return emptyPass();
    } else if (pass_new.get() == "") {
    pass_new.formnode.focus();
    return emptyPass();
    } else if (pass_new2.get() == "") {
    pass_new2.formnode.focus();
    return emptyPass();
    } else if (pass_new.get() != pass_new2.get()) {
    pass_new.formnode.focus();
    ox.Configuration.error(_("The two newly entered passwords do not match."));
    return;
    } else if (check_length == true && pass_new.get().length < minLength) {
    ox.Configuration.error(_("The password length is below min length (" + minLength + ")"));
    return;
    } else if (check_lowercase == true && contains(pass_new.get(),lowercases) == false ){
    ox.Configuration.error(_("The password does not contain characters with lower cases"));
    return;
    } else if (check_uppercase == true && contains(pass_new.get(),uppercases) == false ){
    ox.Configuration.error(_("The password does not contain characters with upper cases"));
    return;
    } else if (check_number == true && contains(pass_new.get(),numbers) == false ){
    ox.Configuration.error(_("The password does not contain numbers"));
    return;
    }

    ox.JSON.put(AjaxRoot+"/passwordchange?action=update&session="+session,dat a,
    function() {
    ox.Configuration.info(
    _("Your new password has been saved."));
    cont();
    });
    }

    // sees if a password contains one of a set of characters
    function contains(password, validChars) {

    for (i = 0; i < password.length; i++) {
    var char = password.charAt(i);
    if (validChars.indexOf(char) > -1) {
    return true;
    }
    }

    return false;

    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •