Changeset 264
- Timestamp:
- 03/09/08 08:55:59 (9 months ago)
- Files:
-
- regext/invite_actions.php (modified) (4 diffs)
- regext/invite_join.php (modified) (2 diffs)
- regext/lib.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
regext/invite_actions.php
r253 r264 263 263 foreach($data['profile:details'] as $datatype) { 264 264 $pd = new StdClass; 265 if (!is_array($datatype) && $datatype->registration && isset($profiledetails[$datatype->internal_name])) {265 if (!is_array($datatype) && isset($datatype->registration) && $datatype->registration && isset($profiledetails[$datatype->internal_name])) { 266 266 $fname = $datatype->internal_name; 267 267 $flabel = $datatype->name; … … 287 287 $valid = true; 288 288 289 if (isset($CFG->display_field_module[$ftype])) { 289 // we handle profile photos separately 290 291 if ($ftype != 'profile_photo' && isset($CFG->display_field_module[$ftype])) { 290 292 $callback = $CFG->display_field_module[$ftype] . "_validate_input_field"; 291 293 if (!$callback($pd)) { … … 327 329 // in /profile/edit.php 328 330 329 function regext_profile_update($validated_values,$access,$owner ,$publish) {330 global $ data;331 function regext_profile_update($validated_values,$access,$owner) { 332 global $CFG, $data; 331 333 332 334 // just in case the tegistration form is submitted multiple time, delete any data that … … 341 343 $insert_id = insert_record('profile_data',$insertvalue); 342 344 $insertvalue->ident = $insert_id; 343 //if ($publish) {344 // plugin_hook("profile_data","publish",$insertvalue);345 //}346 345 347 346 // insert the keywords 348 347 349 348 foreach($data['profile:details'] as $datatype) { 350 if (!is_array($datatype) && $datatype->registration && $insertvalue->name == $datatype->internal_name349 if (!is_array($datatype) && isset($datatype->registration) && $datatype->registration && $insertvalue->name == $datatype->internal_name 351 350 && $datatype->field_type == "keywords") { 352 351 353 352 insert_tags_from_string ($insertvalue->value, $insertvalue->name, $insert_id, $insertvalue->access, $insertvalue->owner); 354 353 } 354 355 // insert the profile photo, if this is one 356 357 if (isset($datatype->registration) && $datatype->registration 358 && $insertvalue->name == $datatype->internal_name && $datatype->field_type == "profile_photo") { 359 require_once($CFG->dirroot.'lib/uploadlib.php'); 360 require_once($CFG->dirroot.'lib/filelib.php'); 361 $textlib = textlib_get_instance(); 362 $upload_folder = $textlib->substr(user_info("username", $owner),0,1); 363 $um = new upload_manager('profile_photo_'.$datatype->internal_name,true,true,false,5000000,true); 364 $username = user_info("username", $owner); 365 $reldir = "profile_photos/" . $upload_folder . "/" . $username . "/" . $insertvalue->name . "/"; 366 $dir = $CFG->dataroot .$reldir; 367 if ($um->process_file_uploads($dir)) { 368 $insertvalue->value = $reldir . $um->get_new_filename(); 369 update_record('profile_data',$insertvalue); 370 } else { 371 $messages[] = $um->get_errors(); 372 } 373 } 355 374 } 356 375 } regext/invite_join.php
r253 r264 6 6 require_once($CFG->dirroot.'mod/profile/profile.config.php'); 7 7 8 if ( $_SESSION['problem_fields']) {8 if (isset($_SESSION['problem_fields'])) { 9 9 $problem_fields = $_SESSION['problem_fields']; 10 10 unset($_SESSION['problem_fields']); 11 } else { 12 $problem_fields = array(); 11 13 } 12 14 … … 61 63 62 64 $run_result .= <<< END 63 <form action="" method="post" >65 <form action="" method="post" enctype="multipart/form-data"> 64 66 65 67 END; regext/lib.php
r253 r264 33 33 global $CFG; 34 34 global $data; 35 global $function; 35 36 36 37 $sitename = $CFG->sitename; … … 59 60 60 61 foreach($data['profile:details'] as $datatype) { 61 if (!is_array($datatype) && $datatype->registration) {62 if ( $datatype->invisible|| (isset($datatype->default_access) && $datatype->default_access == 'PRIVATE')) {62 if (!is_array($datatype) && isset($datatype->registration) && $datatype->registration) { 63 if ((isset($datatype->invisible) && $datatype->invisible) || (isset($datatype->default_access) && $datatype->default_access == 'PRIVATE')) { 63 64 // private 64 65 $access = 'user'.$ident; … … 128 129 if ($ok) { 129 130 $messages[] = __gettext("You have been logged on."); 130 if (md5($ p) == md5("password")) {131 if (md5($displaypassword) == md5("password")) { 131 132 $_SESSION['messages'][] = __gettext("The password for this account is extremely insecure and represents a major security risk. You should change it immediately."); 132 133 }
