logo       

mantisbt/core profile_api.php,1.11,1.12: msg#00038

Subject: mantisbt/core profile_api.php,1.11,1.12
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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe