<?php
/**
- * account.php - A library of common account management functions.
+ * FusionForge account functions
*
- * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 1999-2001, VA Linux Systems, Inc.
*
- * @version $Id$
+ * This file is part of FusionForge.
*
- * This file is part of GForge.
- *
- * GForge is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
*/
/**
*
*/
function account_pwvalid($pw) {
- global $Language;
if (strlen($pw) < 6) {
$GLOBALS['register_error'] = _('Password must be at least 6 characters.');
return 0;
*
*/
function account_namevalid($name) {
- global $Language;
+ global $sys_use_shell;
+
// no spaces
if (strrpos($name,' ') > 0) {
$GLOBALS['register_error'] = _('There cannot be any spaces in the login name.');
if (eregi("^((root)|(bin)|(daemon)|(adm)|(lp)|(sync)|(shutdown)|(halt)|(mail)|(news)"
. "|(uucp)|(operator)|(games)|(mysql)|(httpd)|(nobody)|(dummy)"
. "|(www)|(cvs)|(shell)|(ftp)|(irc)|(debian)|(ns)|(download))$",$name)) {
- $GLOBALS['register_error'] = "Name is reserved.";
+ $GLOBALS['register_error'] = _('Name is reserved.');
return 0;
}
- if ( exec("getent passwd $name") != "" ){
- $GLOBALS['register_error'] = _('That username already exists.');
- return 0;
+ if ($sys_use_shell) {
+ if ( exec("getent passwd $name") != "" ){
+ $GLOBALS['register_error'] = _('That username already exists.');
+ return 0;
+ }
+ if ( exec("getent group $name") != "" ){
+ $GLOBALS['register_error'] = _('That username already exists.');
+ return 0;
+ }
}
if (eregi("^(anoncvs_)",$name)) {
$GLOBALS['register_error'] = _('Name is reserved for CVS.');
*
*/
function account_groupnamevalid($name) {
- global $Language;
if (!account_namevalid($name)) return 0;
// illegal names
return $GLOBALS['groupdir_prefix'].'/'.$group;
}
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
?>