Changeset 1436

Show
Ignore:
Timestamp:
12/09/07 09:52:59 (8 months ago)
Author:
rho
Message:

fixed #204

  • updated missing changes
  • check empty name on register

Signed-off: Rolando Espinoza La fuente <rho@prosoftpeople.com>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/friend/lib.php

    r1248 r1436  
    4444                                       'html' => a_href( "{$CFG->wwwroot}{$friends_username}/friends/requests", 
    4545                                                          __gettext("Friendship requests"))); 
    46  
    47                if ($CFG->publicinvite == true && ($CFG->maxusers == 0 || (count_users('person') < $CFG->maxusers))) { 
    48                     $PAGE->menu_sub[] = array( 'name' => 'friend:invite', 
    49                                                'html' => a_href( "{$CFG->wwwroot}invite/", 
    50                                                                   __gettext("Invite a friend"))); 
    51                 } 
    5246 
    5347            } 
  • devel/mod/invite/forgotten_password.php

    r1369 r1436  
    1616        $body = run("invite:password:request"); 
    1717         
    18         templates_page_output($title, $body, null, '&nbsp;'); 
     18        templates_page_output($title, $body); 
    1919 
    2020?> 
  • devel/mod/invite/lib.php

    r1251 r1436  
    88 */ 
    99 
    10  function invite_pagesetup(){ 
    11     require_once (dirname(__FILE__)."/lib/invite_config.php"); 
    12  } 
    13  
    1410 function invite_init(){ 
    1511  global $CFG, $function; 
    1612  // Actions 
     13      $function['invite:init'][] = $CFG->dirroot . "mod/invite/lib/invite_config.php"; 
    1714      $function['invite:init'][] = $CFG->dirroot . "mod/invite/lib/invite_actions.php"; 
    1815 
    1916  // Introductory text 
    20       $function['content:invite:invite'][] = $CFG->dirroot . "content/invite/invite.php"; 
     17      $function['content:invite:invite'][] = $CFG->dirroot . "mod/invite/lib/content_invite.php"; 
    2118 
    2219  // Allow user to invite a friend 
     
    3936 
    4037 } 
     38 
     39function invite_pagesetup() { 
     40    global $PAGE; 
     41 
     42    if (defined('context') && context == 'network') { 
     43        if (!maxusers_limit()) { 
     44            $PAGE->menu_sub[] = array( 'name' => 'invite:friend', 
     45                                       'html' => a_href(get_url(null, 'invite::invite'), 
     46                                                        __gettext("Invite a friend"))); 
     47        } 
     48    } 
     49} 
     50 
     51function invite_url($object_id, $object_type) { 
     52    $url = null; 
     53 
     54    switch ($object_type) { 
     55        case 'invite::': 
     56        case 'invite::invite': 
     57            global $CFG; 
     58            $url = $CFG->wwwroot . 'mod/invite/'; 
     59            break; 
     60    } 
     61 
     62    return $url; 
     63} 
    4164?> 
  • devel/mod/invite/lib/invite_actions.php

    r1431 r1436  
    22global $USER; 
    33global $CFG; 
    4  
    5 // Ensure that config options are available 
    6 require_once $CFG->dirroot . "mod/invite/lib/invite_config.php"; 
    74 
    85// Kill all old invitations 
     
    8986                 break; 
    9087             } 
     88             if (empty($name)) { 
     89                $messages[] = __gettext('Error! You must provide a name.'); 
     90                break; 
     91             } 
    9192             if (empty($over13)) { 
    9293                 $messages[] = __gettext("You must indicate that you are at least 13 years old to join.");