Skip to content

Commit

Permalink
Improve indentation - left inconsistent by previous recent commits.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Jan 12, 2010
1 parent 94dc37c commit a472727
Show file tree
Hide file tree
Showing 174 changed files with 9,580 additions and 9,602 deletions.
12 changes: 6 additions & 6 deletions account_manage_columns_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
require_api( 'html_api.php' );
require_api( 'lang_api.php' );

html_page_top( lang_get( 'manage_columns_config' ) );
html_page_top( lang_get( 'manage_columns_config' ) );

# Define constant that will be checked by the include page.
define ( 'ACCOUNT_COLUMNS', '' );
# Define constant that will be checked by the include page.
define ( 'ACCOUNT_COLUMNS', '' );

current_user_ensure_unprotected();
current_user_ensure_unprotected();

include ( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'manage_columns_inc.php' );
include ( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'manage_columns_inc.php' );

html_page_bottom();
html_page_bottom();
51 changes: 25 additions & 26 deletions account_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,53 +73,52 @@
require_api( 'user_api.php' );
require_api( 'utility_api.php' );

#============ Parameters ============
# (none)
#============ Parameters ============
# (none)

#============ Permissions ============
auth_ensure_user_authenticated();
#============ Permissions ============
auth_ensure_user_authenticated();

current_user_ensure_unprotected();
current_user_ensure_unprotected();

# extracts the user information for the currently logged in user
# and prefixes it with u_
$row = user_get_row( auth_get_current_user_id() );
extract( $row, EXTR_PREFIX_ALL, 'u' );
# extracts the user information for the currently logged in user
# and prefixes it with u_
$row = user_get_row( auth_get_current_user_id() );
extract( $row, EXTR_PREFIX_ALL, 'u' );

$t_ldap = ( LDAP == config_get( 'login_method' ) );
$t_ldap = ( LDAP == config_get( 'login_method' ) );

# In case we're using LDAP to get the email address... this will pull out
# that version instead of the one in the DB
$u_email = user_get_email( $u_id, $u_username );
# In case we're using LDAP to get the email address... this will pull out
# that version instead of the one in the DB
$u_email = user_get_email( $u_id, $u_username );

# note if we are being included by a script of a different name, if so,
# this is a mandatory password change request
$t_force_pw_reset = is_page_name( 'verify.php' );
# note if we are being included by a script of a different name, if so,
# this is a mandatory password change request
$t_force_pw_reset = is_page_name( 'verify.php' );

# Only show the update button if there is something to update.
$t_show_update_button = false;
# Only show the update button if there is something to update.
$t_show_update_button = false;

html_page_top( lang_get( 'account_link' ) );
html_page_top( lang_get( 'account_link' ) );
?>

<!-- # Edit Account Form BEGIN -->
<br />
<?php if ( $t_force_pw_reset ) { ?>
<center><div style="color:red; width:75%">
<?php
echo lang_get( 'verify_warning' );
if ( helper_call_custom_function( 'auth_can_change_password', array() ) ) {
echo '<br />' . lang_get( 'verify_change_password' );
}
?>
<?php
echo lang_get( 'verify_warning' );
if ( helper_call_custom_function( 'auth_can_change_password', array() ) ) {
echo '<br />' . lang_get( 'verify_change_password' );
}
?>
</div></center>
<br />
<?php } ?>
<div align="center">
<form method="post" action="account_update.php">
<?php echo form_security_field( 'account_update' ); ?>
<table class="width75" cellspacing="1">

<!-- Headings -->
<tr>
<td class="form-title">
Expand Down
38 changes: 19 additions & 19 deletions account_prefs_inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,29 @@
require_api( 'user_pref_api.php' );
require_api( 'utility_api.php' );

function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '') {
if ( null === $p_user_id ) {
$p_user_id = auth_get_current_user_id();
}
function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '') {
if ( null === $p_user_id ) {
$p_user_id = auth_get_current_user_id();
}

$t_redirect_url = $p_redirect_url;
if ( is_blank( $t_redirect_url ) ) {
$t_redirect_url = 'account_prefs_page.php';
}
$t_redirect_url = $p_redirect_url;
if ( is_blank( $t_redirect_url ) ) {
$t_redirect_url = 'account_prefs_page.php';
}

# protected account check
if ( user_is_protected( $p_user_id ) ) {
if ( $p_error_if_protected ) {
trigger_error( ERROR_PROTECTED_ACCOUNT, ERROR );
} else {
return;
}
# protected account check
if ( user_is_protected( $p_user_id ) ) {
if ( $p_error_if_protected ) {
trigger_error( ERROR_PROTECTED_ACCOUNT, ERROR );
} else {
return;
}
}

# prefix data with u_
$t_pref = user_pref_get( $p_user_id );
# prefix data with u_
$t_pref = user_pref_get( $p_user_id );

# Account Preferences Form BEGIN
# Account Preferences Form BEGIN
?>
<br />
<div align="center">
Expand Down Expand Up @@ -325,4 +325,4 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</div>

<?php
} # end of edit_account_prefs()
} # end of edit_account_prefs()
18 changes: 9 additions & 9 deletions account_prefs_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@
require_api( 'html_api.php' );
require_api( 'lang_api.php' );

#============ Parameters ============
# (none)
#============ Parameters ============
# (none)

#============ Permissions ============
auth_ensure_user_authenticated();
#============ Permissions ============
auth_ensure_user_authenticated();

current_user_ensure_unprotected();
current_user_ensure_unprotected();

include( 'account_prefs_inc.php' );
include( 'account_prefs_inc.php' );

html_page_top( lang_get( 'change_preferences_link' ) );
html_page_top( lang_get( 'change_preferences_link' ) );

edit_account_prefs();
edit_account_prefs();

html_page_bottom();
html_page_bottom();
42 changes: 21 additions & 21 deletions account_prefs_reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,31 @@
require_api( 'user_api.php' );
require_api( 'user_pref_api.php' );

#============ Parameters ============
$f_user_id = gpc_get_int( 'user_id' );
$f_redirect_url = string_sanitize_url( gpc_get_string( 'redirect_url', 'account_prefs_page.php' ) );
#============ Parameters ============
$f_user_id = gpc_get_int( 'user_id' );
$f_redirect_url = string_sanitize_url( gpc_get_string( 'redirect_url', 'account_prefs_page.php' ) );

#============ Permissions ============
form_security_validate( 'account_prefs_reset' );
#============ Permissions ============
form_security_validate( 'account_prefs_reset' );

auth_ensure_user_authenticated();
auth_ensure_user_authenticated();

user_ensure_exists( $f_user_id );
user_ensure_exists( $f_user_id );

# This page is currently called from the manage_* namespace and thus we
# have to allow authorised users to update the accounts of other users.
# TODO: split this functionality into manage_user_prefs_reset.php
if ( auth_get_current_user_id() != $f_user_id ) {
access_ensure_global_level( config_get( 'manage_user_threshold' ) );
} else {
# Protected users should not be able to update the preferences of their
# user account. The anonymous user is always considered a protected
# user and hence will also not be allowed to update preferences.
user_ensure_unprotected( $f_user_id );
}
# This page is currently called from the manage_* namespace and thus we
# have to allow authorised users to update the accounts of other users.
# TODO: split this functionality into manage_user_prefs_reset.php
if ( auth_get_current_user_id() != $f_user_id ) {
access_ensure_global_level( config_get( 'manage_user_threshold' ) );
} else {
# Protected users should not be able to update the preferences of their
# user account. The anonymous user is always considered a protected
# user and hence will also not be allowed to update preferences.
user_ensure_unprotected( $f_user_id );
}

user_pref_delete( $f_user_id );
user_pref_delete( $f_user_id );

form_security_purge( 'account_prefs_reset' );
form_security_purge( 'account_prefs_reset' );

print_header_redirect( $f_redirect_url, true, true );
print_header_redirect( $f_redirect_url, true, true );

0 comments on commit a472727

Please sign in to comment.