diff -r 000000000000 -r 3906ca745819 packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/functions.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/functions.php Tue Jan 08 23:13:29 2013 -0500 @@ -0,0 +1,44 @@ + $code + , 'message' => $message + ); +} + +function smarty_function_get_next_uid() +{ + return get_next_available_uid(); +} + +function load_credentials() +{ + $config = yaml_parse_file("/usr/local/etc/ssoinabox/webcreds.yml"); + $keys = array('LDAP_BASEDN', 'UID_MIN', 'GID_MIN', 'ldap_server', 'ldap_manager', 'ldap_user_basedn', 'ldap_group_basedn', 'kerberos_admin', 'PHONE_EXT_MIN'); + + foreach ( $keys as $key ) + { + if ( !isset($config[$key]) ) + die("Config key $key is not set"); + + if ( preg_match('/^[A-Z_]+$/', $key) ) + define($key, $config[$key]); + else + $GLOBALS[$key] = $config[$key]; + } +}