# HG changeset patch # User Dan Fuhry # Date 1361647598 18000 # Node ID f4bf6556fb9f1f43adb4c5229fcc051bdd260ef3 # Parent f68fdcc18df935962155f5d960d1c85f9fc3fdf5# Parent faf6f7941e8f1e640bbcf781f92e8a867f82b731 Merged diff -r f68fdcc18df9 -r f4bf6556fb9f make-sso --- a/make-sso Sat Feb 23 14:26:05 2013 -0500 +++ b/make-sso Sat Feb 23 14:26:38 2013 -0500 @@ -152,11 +152,11 @@ # seeds /dev/random rather nicely... screen -dmS hasher sh -c "find /usr/lib/ /usr/share/ -print0 -type f | xargs -0 -n1 sha1sum" -if [ -f /etc/krb5kdc/principal ]; then - rm -fv /etc/krb5kdc/principal \ - /etc/krb5kdc/principal.kadm5 \ - /etc/krb5kdc/principal.kadm5.lock \ - /etc/krb5kdc/principal.ok +if [ -f /var/lib/krb5kdc/principal ]; then + rm -fv /var/lib/krb5kdc/principal \ + /var/lib/krb5kdc/principal.kadm5 \ + /var/lib/krb5kdc/principal.kadm5.lock \ + /var/lib/krb5kdc/principal.ok fi echo -en "${stash_pw}\n${stash_pw}\n" | kdb5_util create -s diff -r f68fdcc18df9 -r f4bf6556fb9f packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/templates/header.tpl --- a/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/templates/header.tpl Sat Feb 23 14:26:05 2013 -0500 +++ b/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/templates/header.tpl Sat Feb 23 14:26:38 2013 -0500 @@ -5,7 +5,7 @@ {$title} • SSO-in-a-Box Control Panel - + diff -r f68fdcc18df9 -r f4bf6556fb9f packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/templates/my-account.tpl --- a/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/templates/my-account.tpl Sat Feb 23 14:26:05 2013 -0500 +++ b/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/templates/my-account.tpl Sat Feb 23 14:26:38 2013 -0500 @@ -26,7 +26,7 @@
- +

Enter an e-mail address if you want to be able to use password recovery.

diff -r f68fdcc18df9 -r f4bf6556fb9f packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/index.php --- a/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/index.php Sat Feb 23 14:26:05 2013 -0500 +++ b/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/index.php Sat Feb 23 14:26:38 2013 -0500 @@ -42,10 +42,36 @@ break; case 'profile-update': // header('Content-type: text/plain'); print_r(!empty($_POST['sshPublicKey']) ? $_POST['sshPublicKey'] : array()); exit; - $result = ldap_mod_replace($_ldapconn, ldap_make_user_dn($_SERVER['REMOTE_USER']), array( - 'mail' => array($_POST['mail']) - , 'sshPublicKey' => !empty($_POST['sshPublicKey']) ? array_unique($_POST['sshPublicKey']) : array() - )); + $ui = ldap_get_user($_SERVER['REMOTE_USER']); + + foreach ( array('mail', 'sshPublicKey') as $field ) + { + if ( empty($_POST[$field]) && empty($ui[$field]) ) + { + // both empty, do nothing + } + else if ( empty($_POST[$field]) && !empty($ui[$field]) ) + { + // POST empty, database not. Delete attr. + $result = ldap_mod_del($_ldapconn, ldap_make_user_dn($_SERVER['REMOTE_USER']), array( + $field => array() + )); + } + else if ( !empty($_POST[$field]) && empty($ui[$field]) ) + { + // POST filled, database empty. Add attr. + $result = ldap_mod_add($_ldapconn, ldap_make_user_dn($_SERVER['REMOTE_USER']), array( + $field => is_array($_POST[$field]) ? array_unique($_POST[$field]) : array($_POST[$field]) + )); + } + else if ( !empty($_POST[$field]) && !empty($ui[$field]) ) + { + // POST and database filled. Replace attr. + $result = ldap_mod_replace($_ldapconn, ldap_make_user_dn($_SERVER['REMOTE_USER']), array( + $field => is_array($_POST[$field]) ? array_unique($_POST[$field]) : array($_POST[$field]) + )); + } + } if ( $result || ldap_error($_ldapconn) === 'Success' ) { diff -r f68fdcc18df9 -r f4bf6556fb9f packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/res/tablesorter/themes/bootstrap/asc.gif Binary file packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/res/tablesorter/themes/bootstrap/asc.gif has changed diff -r f68fdcc18df9 -r f4bf6556fb9f packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/res/tablesorter/themes/bootstrap/bg.gif Binary file packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/res/tablesorter/themes/bootstrap/bg.gif has changed diff -r f68fdcc18df9 -r f4bf6556fb9f packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/res/tablesorter/themes/bootstrap/desc.gif Binary file packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/res/tablesorter/themes/bootstrap/desc.gif has changed diff -r f68fdcc18df9 -r f4bf6556fb9f packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/res/tablesorter/themes/bootstrap/style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/res/tablesorter/themes/bootstrap/style.css Sat Feb 23 14:26:38 2013 -0500 @@ -0,0 +1,14 @@ +/* tables */ + +table.tablesorter thead tr .header { + background-image: url(bg.gif); + background-repeat: no-repeat; + background-position: center right; + cursor: pointer; +} +table.tablesorter thead tr .headerSortUp { + background-image: url(asc.gif); +} +table.tablesorter thead tr .headerSortDown { + background-image: url(desc.gif); +} diff -r f68fdcc18df9 -r f4bf6556fb9f resources/functions --- a/resources/functions Sat Feb 23 14:26:05 2013 -0500 +++ b/resources/functions Sat Feb 23 14:26:38 2013 -0500 @@ -257,8 +257,8 @@ [realms] $krb5_realm = { - database_name = /etc/krb5kdc/principal - key_stash_file = /etc/krb5kdc/.k5.$krb5_realm + database_name = /var/lib/krb5kdc/principal + key_stash_file = /etc/krb5kdc/stash } EOF