Update of /cvsroot/mantisbt/mantisbt/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10090/core
Modified Files:
profile_api.php
Log Message:
- Fixed a bug in profile_is_global() which broke the editing of private
profiles.
- Added the name of the missing mandatory field when adding/updating a profile
and not entering a mandatory field.
Index: profile_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/profile_api.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- profile_api.php 26 Feb 2005 15:16:46 -0000 1.11
+++ profile_api.php 21 Mar 2005 12:44:20 -0000 1.12
@@ -32,8 +32,21 @@
user_ensure_unprotected( $p_user_id );
}
- # platform, os, os_build cannot be blank
- if ( is_blank( $c_platform ) || is_blank( $c_os ) || is_blank(
$c_os_build ) ) {
+ # platform cannot be blank
+ if ( is_blank( $c_platform ) ) {
+ error_parameters( lang_get( 'platform' ) );
+ trigger_error( ERROR_EMPTY_FIELD, ERROR );
+ }
+
+ # os cannot be blank
+ if ( is_blank( $c_os ) ) {
+ error_parameters( lang_get( 'operating_system' ) );
+ trigger_error( ERROR_EMPTY_FIELD, ERROR );
+ }
+
+ # os_build cannot be blank
+ if ( is_blank( $c_os_build ) ) {
+ error_parameters( lang_get( 'version' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
@@ -88,8 +101,21 @@
user_ensure_unprotected( $p_user_id );
}
- # platform, os, os_build cannot be blank
- if ( is_blank( $c_platform ) || is_blank( $c_os ) || is_blank(
$c_os_build ) ) {
+ # platform cannot be blank
+ if ( is_blank( $c_platform ) ) {
+ error_parameters( lang_get( 'platform' ) );
+ trigger_error( ERROR_EMPTY_FIELD, ERROR );
+ }
+
+ # os cannot be blank
+ if ( is_blank( $c_os ) ) {
+ error_parameters( lang_get( 'operating_system' ) );
+ trigger_error( ERROR_EMPTY_FIELD, ERROR );
+ }
+
+ # os_build cannot be blank
+ if ( is_blank( $c_os_build ) ) {
+ error_parameters( lang_get( 'version' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
@@ -186,7 +212,8 @@
# --------------------
# Returns whether the specified profile is global
function profile_is_global( $p_profile_id ) {
- return 0 < count( profile_get_row( ALL_USERS, $p_profile_id ) );
+ $t_row = profile_get_row( ALL_USERS, $p_profile_id );
+ return ( $t_row !== false );
}
#===================================
# Data Modification
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
|