head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	99.08.04.04.16.00;	author chuck;	state dead;
branches;
next	1.1;

1.1
date	99.07.20.07.36.30;	author jon;	state Exp;
branches;
next	;


desc
@@


1.2
log
@cjh: pruning out all the code that either isn't used or is only used for
maintaining/creating users - all of which is moving to Horde proper. Also a
few more fixes for the new session/user stuff, though I haven't quite gotten
rid of the "users" table yet - that's coming, though.

babel.php3 is a nice bit shorter, now... ;)

Anyway, a bit more work, and a better Horde user framework, and babel should
be more or less ready for primetime. oh, there's that whole customization
thing, too.

Speaking of which, what do people prefer: imp-style defaults.php3, or
babel-style babel.conf. I figure we should standardize on one; they're both
easy to auto-generate; babel's is maybe a little bit more overhead to parse,
but it's a bit more user friendly as well. Thoughts?
@
text
@function signup_user (&$request_ref) {
  global $firstname, $lastname, $email, $username;
  
  if (!(firstname_is_valid($firstname)))
    return error("firstname is not valid");
  
  if (!(lastname_is_valid($lastname)))
    return error("lastname is not valid");
  
  if (!(email_is_valid($email)))
    return error("email is not valid");
  
  if (!(username_is_valid($username)))
    return error("username is not valid");
  
  if (!(does_username_exist($request_ref, $username, $username_exists)))
    return error("could not check if username exists");
  
  if (!(does_email_exist($request_ref, $email, $email_exists, $username)))
    return error("could not check if email exists");
  
  if ($email_exists)
    return error("email '$email' already exists");
  
  if ($username_exists)
    return error("username '$username' already exists");
  
  if (!(generate_password($request_ref, $password)))
    return error("could not generate password");
  
  if (!(create_new_user($request_ref, $firstname, $lastname, $email, $username, $password)))
    return error("could not create new user");
  
  if (!(send_new_user_mail($request_ref, $email, $username, $password)))
    return error("could not send new user mail");
  
  if ($request_ref->topic) {
    if (!(restore_state($request_ref)))
      return error("could not restore state");
  }
  
  if (!(build_navigation_bar($request_ref, $var_hash['nav_bar'])))
    return error("could not build navigation bar");
  
  if (!(build_status_bar($request_ref, $var_hash['status'])))
    return error("could not build status bar");
  
  if (!(build_search_button($request_ref, $var_hash['search'])))
    return error("could not build search button");
  
  $var_hash['body_tags'] = make_body_tags($request_ref);
  
  if (!(export_state($request_ref, $var_hash)))
    return error("could not export state");
  
  if (!(print_template($request_ref->conf['new_user_template'], $var_hash)))
    return error("couldn't print 'new_user_template'");
  
  return success();
}
@


1.1
log
@
jon: alrighty, babel.php3.in is now broken down into seperate
     function files.  they're jusy dying to be combined into
     objects and seperate source files.
@
text
@@

