diff --git a/contrib/bin/fusiondirectory-setup b/contrib/bin/fusiondirectory-setup index 20ed1b8818b8c0e817f6adddded7e7ed814b7efc..f2236a18b2fb7defd3828a6e18e9ab0050708847 100644 --- a/contrib/bin/fusiondirectory-setup +++ b/contrib/bin/fusiondirectory-setup @@ -859,6 +859,14 @@ This option will install the plugin from a tar.gz of the plugin. This option is This option will change the path for fusiondirectory installation. it is only usefull with other commands and for people installing from sources. +=item --list_vars + +This option will list the variables you can change to install FusionDirectory on another set of directories. This option is intended for people wanting to install from the sources. + +=item --set-VAR=variable + +This option will change the variable for the FusionDirectory installation. it is only usefull with --install-directories and for people installing from sources. + =item --yes This flag will answer "yes" to every yes/no question asked by the script @@ -870,9 +878,26 @@ This flag will answer "yes" to every yes/no question asked by the script benoit@catbert$ fusiondirectory-setup --update-cache --update-locales Update FusionDirectory class cache and update localization -=head1 AUTHOR + benoit@catbert$ fusiondirectory-setup --list-vars + List possible vars to give --set + locale_cache_dir [locale] + config_file [fusiondirectory.conf] + fd_cache [/var/cache/fusiondirectory] + fd_spool_dir [/var/spool/fusiondirectory] + fai_log_dir [fai] + tmp_dir [tmp] + template_dir [template] + locale_dir [locale] + fd_config_dir [/etc/fusiondirectory] + class_cache [class.cache] + fd_home [/usr/share/fusiondirectory] + + benoit@catbert$ fusiondirectory-setup --install-directories --set-class_cache=class.cache + +=head1 AUTHORS Benjamin Carpentier +Côme Bernigaud =head1 LICENCE AND COPYRIGHT diff --git a/contrib/man/fusiondirectory-setup.1 b/contrib/man/fusiondirectory-setup.1 index fcb07887854ce4231eb1980dd2c8cafb1e258ad2..c5c72fe0117520361ea4dfc09bfd4fb8aa1f2401 100644 --- a/contrib/man/fusiondirectory-setup.1 +++ b/contrib/man/fusiondirectory-setup.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.07) +.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "FUSIONDIRECTORY-SETUP 1" -.TH FUSIONDIRECTORY-SETUP 1 "2012-01-31" "FusionDirectory 1.0" "FusionDirectory Documentation" +.TH FUSIONDIRECTORY-SETUP 1 "2012-05-16" "Argonaut 1.0" "Argonaut Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -147,18 +147,30 @@ Needs \fImsgcat\fR and \fImsgfmt\fR to be installed. .IP "\-\-check\-directories" 4 .IX Item "--check-directories" This option perform a check on all FusionDirectory's files or directories. +.IP "\-\-check\-config" 4 +.IX Item "--check-config" +This option perform a check on FusionDirectory's config file. .IP "\-\-check\-ldap" 4 .IX Item "--check-ldap" This option check your \s-1LDAP\s0 tree. Looking for admin account, and groups or people branch. If one of those don't exists, the script will ask you what to do. .IP "\-\-migrate\-repositories" 4 .IX Item "--migrate-repositories" This option check the fairepository object in your ldap tree and add the new option for FusionDirectory 1.0.2. +.IP "\-\-migrate\-users" 4 +.IX Item "--migrate-users" +This option add FusionDirectory attributes to the people branch. .IP "\-\-install\-plugins" 4 .IX Item "--install-plugins" This option will install the plugin from a tar.gz of the plugin. This option is intended for people wanting to install from the sources. .IP "\-\-install\-directories" 4 .IX Item "--install-directories" This option will change the path for fusiondirectory installation. it is only usefull with other commands and for people installing from sources. +.IP "\-\-list_vars" 4 +.IX Item "--list_vars" +This option will list the variables you can change to install FusionDirectory on another set of directories. This option is intended for people wanting to install from the sources. +.IP "\-\-set\-VAR=variable" 4 +.IX Item "--set-VAR=variable" +This option will change the variable for the FusionDirectory installation. it is only usefull with \-\-install\-directories and for people installing from sources. .IP "\-\-yes" 4 .IX Item "--yes" This flag will answer \*(L"yes\*(R" to every yes/no question asked by the script @@ -167,10 +179,27 @@ This flag will answer \*(L"yes\*(R" to every yes/no question asked by the script .Vb 2 \& benoit@catbert$ fusiondirectory\-setup \-\-update\-cache \-\-update\-locales \& Update FusionDirectory class cache and update localization +\& +\& benoit@catbert$ fusiondirectory\-setup \-\-list\-vars +\& List possible vars to give \-\-set +\& locale_cache_dir [locale] +\& config_file [fusiondirectory.conf] +\& fd_cache [/var/cache/fusiondirectory] +\& fd_spool_dir [/var/spool/fusiondirectory] +\& fai_log_dir [fai] +\& tmp_dir [tmp] +\& template_dir [template] +\& locale_dir [locale] +\& fd_config_dir [/etc/fusiondirectory] +\& class_cache [class.cache] +\& fd_home [/usr/share/fusiondirectory] +\& +\& benoit@catbert$ fusiondirectory\-setup \-\-install\-directories \-\-set\-class_cache=class.cache .Ve -.SH "AUTHOR" -.IX Header "AUTHOR" +.SH "AUTHORS" +.IX Header "AUTHORS" Benjamin Carpentier +CA\*~Xme Bernigaud .SH "LICENCE AND COPYRIGHT" .IX Header "LICENCE AND COPYRIGHT" This code is part of FusionDirectory (http://www.fusiondirectory.org/) diff --git a/include/class_tests.inc b/include/class_tests.inc index 166242eab1994d4f62f3e8e0d9a5cb886edc4e07..3b1fa05263dcd670b5cc854b7c59cbfd435bc77b 100644 --- a/include/class_tests.inc +++ b/include/class_tests.inc @@ -32,7 +32,7 @@ * * The functions need to be handled with care, because they are not as strict * as one might expect. - */ + */ class tests { /*! \brief Test if the given string is a phone number */ @@ -46,8 +46,15 @@ class tests { } - /*! \brief Test if the given string contains characters allowed in a DNS name */ + /*! \brief Test if the given string contains characters allowed in a DNS record name */ public static function is_dns_name($str) + { + return(preg_match("/^[a-z0-9\.\-_]*$/i",$str)); + } + + + /*! \brief Test if the given string contains characters allowed in a hostname */ + public static function is_valid_hostname($str) { return(preg_match("/^[a-z0-9\.\-]*$/i",$str)); } @@ -123,7 +130,7 @@ class tests { } - /*! \brief Checks if the given ip address dosen't match + /*! \brief Checks if the given ip address dosen't match "is_ip" because there is also a sub net mask given */ public static function is_ip_with_subnetmask($ip) { @@ -239,7 +246,7 @@ class tests { /* \brief Check if $ip1 and $ip2 represents a valid IP range - * \return TRUE in case of a valid range, FALSE in case of an error. + * \return TRUE in case of a valid range, FALSE in case of an error. */ public static function is_ip_range($ip1,$ip2) {