Skip to content

Commit

Permalink
profile management
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@43 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Dec 8, 2000
1 parent 6479b89 commit 5ac8255
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 43 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -28,6 +28,7 @@ To Do:
* Renamed $g_bug_view_all_page $g_bug_view_all_page $g_bug_view_all_page
to $g_view_bug_all_page $g_view_bug_page $g_view_bug_advanced_page
* Renamed corresponding .php3 files
* Added profile management

12.06.2000 - 0.10.2

Expand Down
3 changes: 1 addition & 2 deletions account_delete_page.php3
Expand Up @@ -27,9 +27,8 @@

Are you sure you wish to delete your account?

<form method=post action="<? echo $g_account_update ?>">
<form method=post action="<? echo $g_account_delete ?>">
<input type=hidden name=f_id value="<? echo $f_id ?>">
<input type=hidden name=f_action value="delete">
<input type=submit value=" Delete Account ">
</form>

Expand Down
14 changes: 9 additions & 5 deletions account_page.php3
Expand Up @@ -32,11 +32,16 @@
<p>
<? print_menu( $g_menu_include_file ) ?>

<?
if ( access_level_check_greater( "reporter" ) ) {
?>
<p>
<div align=center>
[ <a href="<? echo $g_account_manage_profiles ?>">Manage Profiles</a> ]
[ <a href="<? echo $g_account_profile_manage_page ?>">Manage Profiles</a> ]
</div>

<?
}
?>
<p>
<div align=center>
<table bgcolor=<? echo $g_primary_border_color ?> width=50%>
Expand All @@ -45,7 +50,6 @@
<table width=100% cols=3>
<form method=post action="<? echo $g_account_update ?>">
<input type=hidden name=f_id value="<? echo $u_id ?>">
<input type=hidden name=f_action value="update">
<tr>
<td>
<b>Edit Account</b>
Expand Down Expand Up @@ -98,8 +102,8 @@
</form>
<td align=right>
<form method=post action="<? echo $g_account_delete_page ?>">
<input type=hidden name=f_id value="<? echo $u_id ?>">
<input type=submit value="Delete Account">
<input type=hidden name=f_id value="<? echo $u_id ?>">
<input type=submit value="Delete Account">
</td>
</form>
</tr>
Expand Down
41 changes: 14 additions & 27 deletions account_update.php3
Expand Up @@ -12,34 +12,21 @@
### If an account is protected then no one can change the information
### This is useful for shared accounts or for demo purposes
if ( $f_protected!="on" ) {
if ( $f_action=="update" ) {
### Update everything except password
$query = "UPDATE $g_mantis_user_table
SET username='$f_username', email='$f_email'
WHERE id='$f_id'";
$result = mysql_query( $query );
### Update everything except password
$query = "UPDATE $g_mantis_user_table
SET username='$f_username', email='$f_email'
WHERE id='$f_id'";
$result = mysql_query( $query );

### Update password if changed and the two match
if ( !empty( $f_password ) ) {
if ( $f_password==$f_password_confirm ) {
$t_password = crypt( $f_password );
$query = "UPDATE $g_mantis_user_table
SET password='$t_password'
WHERE id='$f_id'";
$result = mysql_query( $query );
}
}
} ### end update
else if ( $f_action=="delete" ) {
$query = "DELETE
FROM $g_mantis_user_table
WHERE id='$f_id'";
$result = mysql_query( $query );
### Account is invalid so logout user
header( "Location: $g_logout_page" );
} ### end delete
else {
echo "ERROR: INVALID ACTION";
### Update password if changed and the two match
if ( !empty( $f_password ) ) {
if ( $f_password==$f_password_confirm ) {
$t_password = crypt( $f_password );
$query = "UPDATE $g_mantis_user_table
SET password='$t_password'
WHERE id='$f_id'";
$result = mysql_query( $query );
}
}
} ### end if protected
?>
Expand Down
15 changes: 13 additions & 2 deletions config_inc.php
Expand Up @@ -64,6 +64,7 @@
$g_mantis_bugnote_text_table = $g_db_table_prefix."_bugnote_text_table";
$g_mantis_news_table = $g_db_table_prefix."_news_table";
$g_mantis_user_table = $g_db_table_prefix."_user_table";
$g_mantis_user_profile_table = $g_db_table_prefix."_user_profile_table";

#--------------------
# page names
Expand All @@ -73,7 +74,7 @@
# bug view/update
$g_view_bug_all_page = "view_bug_all_page".$g_php;
$g_view_bug_page = "view_bug_page".$g_php;
$g_view_bug_yadvanced_page = "view_bug_advanced_page".$g_php;
$g_view_bug_yadvanced_page = "view_bug_advanced_page".$g_php;

$g_bug_delete_page = "bug_delete_page".$g_php;
$g_bug_delete = "bug_delete".$g_php;
Expand All @@ -99,8 +100,16 @@

# account
$g_account_page = "account_page".$g_php;
$g_account_delete_page = "account_delete_page".$g_php;
$g_account_update = "account_update".$g_php;
$g_account_delete_page = "account_delete_page".$g_php;
$g_account_delete = "account_delete".$g_php;

$g_account_profile_manage_page = "account_profile_manage_page".$g_php;
$g_account_profile_add = "account_profile_add".$g_php;
$g_account_profile_edit_page = "account_profile_edit_page".$g_php;
$g_account_profile_update = "account_profile_update".$g_php;
$g_account_profile_delete = "account_profile_delete".$g_php;
$g_account_profile_make_default = "account_profile_make_default".$g_php;

# site management
$g_manage_page = "manage_page".$g_php;
Expand All @@ -120,6 +129,8 @@
$g_news_edit_page = "news_edit_page".$g_php;
$g_news_add = "news_add".$g_php;
$g_news_update = "news_update".$g_php;
$g_news_delete_page = "news_delete_page".$g_php;
$g_news_delete = "news_delete".$g_php;

# login
$g_login = "login".$g_php;
Expand Down
2 changes: 1 addition & 1 deletion db_generate.sql
Expand Up @@ -24,7 +24,7 @@ CREATE TABLE mantis_bug_table (
last_updated timestamp(14),
eta enum('none','< 1 day','2-3 days','< 1 week','< 1 month','> 1 month') DEFAULT 'none' NOT NULL,
bug_text_id mediumint(7) unsigned zerofill DEFAULT '0000000' NOT NULL,
os varchar(64) NOT NULL,
os varchar(32) NOT NULL,
os_build varchar(16) NOT NULL,
platform varchar(32) NOT NULL,
version varchar(16) NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion news_edit_page.php3
Expand Up @@ -17,7 +17,7 @@

### If Deleteing item redirect to delete script
if ( $f_action=="delete") {
header( "Location: $g_news_delete?f_id=$f_id" );
header( "Location: $g_news_delete_page?f_id=$f_id" );
exit;
}

Expand Down
8 changes: 4 additions & 4 deletions news_menu_page.php3
Expand Up @@ -55,16 +55,16 @@
Headline<br>
Do not use "
</td>
<td>
<td width=75%>
<input type=text name=f_headline size=64 maxlength=64>
</td>
</tr>
<tr bgcolor=<? echo $g_primary_color_light ?>>
<td width=75%>
<td>
Body
</td>
<td>
<textarea name=f_body cols=60 rows=5></textarea>
<textarea name=f_body cols=60 rows=8></textarea>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -124,7 +124,7 @@
</tr>
<tr>
<td align=center colspan=2>
<input type=submit value=" Edit Post ">
<input type=submit value=" Submit ">
</td>
</form>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion report_bug_advanced_page.php3
Expand Up @@ -97,7 +97,7 @@
OS:
</td>
<td>
<input type=text name=f_os size=32 maxlength=64>
<input type=text name=f_os size=32 maxlength=32>
</td>
</tr>
<tr bgcolor=<? echo $g_primary_color_light ?>>
Expand Down

0 comments on commit 5ac8255

Please sign in to comment.