[ PHPXref.com ] [ Generated: Sun Jul 20 20:18:29 2008 ] [ Siteframe 5.0.2 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/plugins/ -> user_folder.php (source)

   1  <?php
   2  // $Id: user_folder.php,v 1.2 2005/03/01 12:50:58 glen Exp $
   3  // Copyright (c)2005, Glen Campbell. All rights reserved.
   4  //
   5  // This plugin, if enabled, will automatically create a user folder
   6  // for each new user.
   7  
   8  Plugin::add_event('User', 'add', 'user_folder_auto_create');
   9  
  10  // this is the function that automatically creates the user's folder
  11  function user_folder_auto_create(&$user)
  12  {
  13      // build the folder
  14      $f = new Folder;
  15      $f->set('folder_user_id', $user->id());
  16      $f->set('folder_title', $user->get('user_name'));
  17      $f->set('folder_view', 'blog');
  18      $f->set('folder_theme', config('default_site_templates'));
  19      
  20      // return errors to the user object
  21      $f->add();
  22      if (!$f->is_valid())
  23          $user->add_error($f->get_errors());
  24  }
  25  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]