Skip to content

Commit

Permalink
Added Anonymous Login patch.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@733 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Feb 19, 2002
1 parent 687a936 commit cf56fda
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 4 deletions.
12 changes: 10 additions & 2 deletions core_user_API.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,18 @@ function login_user_check_only() {
# --------------------
# Checks for password match using the globally specified login method
function is_password_match( $f_username, $p_test_password, $p_password ) {
global $g_login_method;
global $g_login_method, $g_allow_anonymous_login, $g_anonymous_account;

switch ( $g_login_method ) {
# allow anonymous logins
if ( ON == $g_allow_anonymous_login ) {
if ( $g_anonymous_account == $f_username ) {
return true;
} else {
return false;
}
}

switch ( $g_login_method ) {
case CRYPT: $salt = substr( $p_password, 0, 2 );
if ( crypt( $p_test_password, $salt ) == $p_password ) {
return true;
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Mantis
* Added project name as supplementary info next to bug id in buglist for "All projects" option
* Added Basic Authentication patch.
* Added CSV Export patch.
* Added Anonymous Login patch.

01.23.2002 - 0.17.0

Expand Down
19 changes: 18 additions & 1 deletion doc/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,9 @@ <h2>Content</h2>
<li>PLAIN
<li>CRYPT
<li>MD5
<li>BASIC_AUTH
</ul>
Some systems (mostly non-unix) do not have crypt support in PHP. MD5 will accomplish almost the same thing. PLAIN is plain text and there is no attempt to secure the password in the database. You will not be able to easily convert between encryption methods so this needs to be chosen at install time. CRYPT is the default.
Some systems (mostly non-unix) do not have crypt support in PHP. MD5 will accomplish almost the same thing. PLAIN is plain text and there is no attempt to secure the password in the database. You will not be able to easily convert between encryption methods so this needs to be chosen at install time. CRYPT was the default until 0.17.0; MD5 is now the default.
</td>
</tr>
<tr>
Expand All @@ -1135,6 +1136,22 @@ <h2>Content</h2>
Allow users to delete their own accounts.
</td>
</tr>
<tr>
<td width="20%" bgcolor="#ddddff">
$g_allow_anonymous_login
</td>
<td width="80%" bgcolor="#ffffff">
Allow easy anonymous access.
</td>
</tr>
<tr>
<td width="20%" bgcolor="#ddddff">
$g_anonymous_account
</td>
<td width="80%" bgcolor="#ffffff">
Set the account that users will login as. Make sure this is a viewer or reporter account.
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#eeeeee">
Access level needed to re-open bugs. Look in the constant_inc.php file if you want to set a different value.
Expand Down
1 change: 1 addition & 0 deletions lang/strings_english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
$s_date_order = "Date Order";
$s_print_all_bug_page_link = "Print Reports";
$s_csv_export = "CSV Export";
$s_login_anonymously = "Login Anonymously";

# ERROR strings
$MANTIS_ERROR[ERROR_SQL] = "ERROR: SQL error detected. Please report this to ";
Expand Down
4 changes: 4 additions & 0 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
$login_result = 0;
}

if ( ON == $g_allow_anonymous_login ) {
$f_password = "";
}

$t_project_id = 0;
if (( 1 == $login_result )&&
( ON == $u_enabled )&&
Expand Down
9 changes: 8 additions & 1 deletion login_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@
<?php } ?>
<table class="width50" cellspacing="1">
<tr>
<td class="form-title" colspan="2">
<td class="form-title">
<?php echo $s_login_title ?>
</td>
<td class="right">
<?php
if ( ON == $g_allow_anonymous_login ) {
print_bracket_link( $g_login_anon, $s_login_anonymously );
}
?>
</td>
</tr>
<tr class="row-1">
<td class="category" width="25%">
Expand Down

0 comments on commit cf56fda

Please sign in to comment.