A więc tak, ostatnio chciałem wyłączyć funkcje do zmieniania e - maila, w tym celu wszedłem w "modifypassword" template i zmieniłem source code z:
Kod:
<script type="text/javascript" src="clientscript/vbulletin_md5.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
function hash_passwords(currentpassword, currentpassword_md5, newpassword, newpassword_md5, newpasswordconfirm, newpasswordconfirm_md5)
{//
var junk_output;
md5hash(currentpassword, currentpassword_md5, junk_output, {vb:raw show.nopasswordempty});
// do various checks
if (newpassword.value != '')
{
md5hash(newpassword, newpassword_md5, junk_output, {vb:raw show.nopasswordempty});
}
if (newpasswordconfirm.value != '')
{
md5hash(newpasswordconfirm, newpasswordconfirm_md5, junk_output, {vb:raw show.nopasswordempty});
}
}
</script>
<form action="profile.php?do=updatepassword" method="post" onsubmit="hash_passwords(currentpassword, currentpassword_md5, newpassword, newpassword_md5, newpasswordconfirm, newpasswordconfirm_md5)" class="block">
<h2 class="blockhead"><vb:if condition="$show['edit_email_field']">{vb:rawphrase edit_email_and_password}<vb:else />{vb:rawphrase edit_password}</vb:if></h2>
<div class="blockbody formcontrols settings_form_border">
<vb:if condition="$show['oldpasswordinput']">
<vb:if condition="$show['passwordexpired']">
<h3 class="blocksubhead">{vb:rawphrase current_password_expired}</h3>
</vb:if>
<div class="section">
<div class="blockrow">
<label for="currentpassword">{vb:rawphrase enter_password_to_continue}:</label>
<div class="for_ie7"><input type="password" class="primary textbox" name="currentpassword" id="currentpassword" maxlength="50" /></div>
<p class="description">{vb:rawphrase enter_password_to_change_password_or_email}</p>
</div>
</div>
<vb:else />
<input type="hidden" name="currentpassword" id="currentpassword" />
</vb:if>
<h3 class="blocksubhead">{vb:rawphrase edit_password}<vb:if condition="$show['password_optional'] AND $show['oldpasswordinput']"> ({vb:rawphrase optional})</vb:if></h3>
<div class="section">
<div class="blockrow">
<ul class="group">
<li>
<label for="newpassword">{vb:rawphrase new_password}:</label>
<input type="password" class="textbox" name="newpassword" id="newpassword" maxlength="50" />
</li>
<li>
<label for="newpasswordconfirm">{vb:rawphrase confirm_new_password}:</label>
<input type="password" class="textbox" name="newpasswordconfirm" id="newpasswordconfirm" maxlength="50" />
</li>
</ul>
<p class="description">{vb:rawphrase enter_new_password_case_sensitive}</p>
</div>
</div>
<vb:if condition="$show['edit_email_field']">
<h3 class="blocksubhead">{vb:rawphrase edit_email_address} ({vb:rawphrase optional})</h3>
<div class="section">
<div class="blockrow">
<ul class="group">
<li>
<label for="email">{vb:rawphrase new_email_address}:</label>
<input type="text" class="textbox" name="email" value="{vb:raw bbuserinfo.email}" id="email" maxlength="50" dir="ltr" />
</li>
<li>
<label for="emailconfirm">{vb:rawphrase confirm_new_email_address}:</label>
<input type="text" class="textbox" name="emailconfirm" value="{vb:raw bbuserinfo.email}" id="emailconfirm" maxlength="50" dir="ltr" />
</li>
</ul>
<p class="description">{vb:rawphrase enter_new_email_must_be_able_to_receive}</p>
</div>
</div>
</vb:if>
</div>
<div class="blockfoot actionbuttons settings_form_border">
<div class="group">
<input type="submit" class="button" value="{vb:rawphrase save_changes}" accesskey="s" />
<input type="reset" class="button" value="{vb:rawphrase reset_fields}" accesskey="r" />
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="updatepassword" />
<input type="hidden" name="currentpassword_md5" />
<input type="hidden" name="newpassword_md5" />
<input type="hidden" name="newpasswordconfirm_md5" />
</div>
</div>
</form>
na:
Kod:
<script type="text/javascript" src="clientscript/vbulletin_md5.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
function hash_passwords(currentpassword, currentpassword_md5, newpassword, newpassword_md5, newpasswordconfirm, newpasswordconfirm_md5)
{//
var junk_output;
md5hash(currentpassword, currentpassword_md5, junk_output, {vb:raw show.nopasswordempty});
// do various checks
if (newpassword.value != '')
{
md5hash(newpassword, newpassword_md5, junk_output, {vb:raw show.nopasswordempty});
}
if (newpasswordconfirm.value != '')
{
md5hash(newpasswordconfirm, newpasswordconfirm_md5, junk_output, {vb:raw show.nopasswordempty});
}
}
</script>
<form action="profile.php?do=updatepassword" method="post" onsubmit="hash_passwords(currentpassword, currentpassword_md5, newpassword, newpassword_md5, newpasswordconfirm, newpasswordconfirm_md5)" class="block">
<h2 class="blockhead"><vb:if condition="$show['edit_email_field']">{vb:rawphrase edit_email_and_password}<vb:else />{vb:rawphrase edit_password}</vb:if></h2>
<div class="blockbody formcontrols settings_form_border">
<vb:if condition="$show['oldpasswordinput']">
<vb:if condition="$show['passwordexpired']">
<h3 class="blocksubhead">{vb:rawphrase current_password_expired}</h3>
</vb:if>
<div class="section">
<div class="blockrow">
<label for="currentpassword">{vb:rawphrase enter_password_to_continue}:</label>
<div class="for_ie7"><input type="password" class="primary textbox" name="currentpassword" id="currentpassword" maxlength="50" /></div>
<p class="description">{vb:rawphrase enter_password_to_change_password_or_email}</p>
</div>
</div>
<vb:else />
<input type="hidden" name="currentpassword" id="currentpassword" />
</vb:if>
<h3 class="blocksubhead">{vb:rawphrase edit_password}<vb:if condition="$show['password_optional'] AND $show['oldpasswordinput']"> ({vb:rawphrase optional})</vb:if></h3>
<div class="section">
<div class="blockrow">
<ul class="group">
<li>
<label for="newpassword">{vb:rawphrase new_password}:</label>
<input type="password" class="textbox" name="newpassword" id="newpassword" maxlength="50" />
</li>
<li>
<label for="newpasswordconfirm">{vb:rawphrase confirm_new_password}:</label>
<input type="password" class="textbox" name="newpasswordconfirm" id="newpasswordconfirm" maxlength="50" />
</li>
</ul>
<p class="description">{vb:rawphrase enter_new_password_case_sensitive}</p>
</div>
</div>
</div>
<div class="blockfoot actionbuttons settings_form_border">
<div class="group">
<input type="submit" class="button" value="{vb:rawphrase save_changes}" accesskey="s" />
<input type="reset" class="button" value="{vb:rawphrase reset_fields}" accesskey="r" />
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="updatepassword" />
<input type="hidden" name="currentpassword_md5" />
<input type="hidden" name="newpassword_md5" />
<input type="hidden" name="newpasswordconfirm_md5" />
</div>
</div>
</form>
Chociaż wszystko chciałem tylko żeby użytkownicy nie mogli zmienić e-maila to teraz nie mogą zmienić też i hasła!
Proszę o pomoc ;(