• Rejestracja
vBHELP.pl - polskie wsparcie vBulletin
  1. #1
    Awatar Bryanek
    Bryanek jest nieaktywny Stały bywalec
    Dołączył
    Apr 2011
    Posty
    144
    Przydatne posty
    16

    Domyślnie Użytkownicy nie mogą zmienić hasła!

    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 ;(



  2. #2
    Awatar WoG
    WoG
    WoG jest nieaktywny vB Specialist
    Dołączył
    Feb 2008
    Posty
    2 812
    Przydatne posty
    299
    Wpisów
    1

    Domyślnie

    Takie rozwiazanie jest na krótką metę, bo ktoś potrafiący wykorzystać np. Firebuga - edytuje sobie źródło strony i zmieni e-mail.
    Nawiązując do Twojego problemu - spróbuj tak:
    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" />
    			<input type="hidden" name="email" value="{vb:raw bbuserinfo.email}" />
    			<input type="hidden" name="emailconfirm" value="{vb:raw bbuserinfo.email}" />
    		</div>
    	</div>
    
    </form>
    Z poważaniem,
    WoG

    Ty też możesz pomóc spolszczać vBulletin 5: GitHub.com
    "Rozczarowanie spowodowane niską jakością pamięta się długo po przeminięciu radości spowodowanej niską ceną"


  3. #3
    Awatar Bryanek
    Bryanek jest nieaktywny Stały bywalec
    Dołączył
    Apr 2011
    Posty
    144
    Przydatne posty
    16

    Domyślnie

    Kod:
    Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '188.165.224.179' (4) in [path]/profile.php on line 362
    database error, please try again


  4. #4
    Awatar WoG
    WoG
    WoG jest nieaktywny vB Specialist
    Dołączył
    Feb 2008
    Posty
    2 812
    Przydatne posty
    299
    Wpisów
    1

    Domyślnie

    To nie jest błąd związany z edycją szablonu tylko z Twoim serwerem MySQL.
    Kod:
    Can't connect to MySQL server
    Z poważaniem,
    WoG

    Ty też możesz pomóc spolszczać vBulletin 5: GitHub.com
    "Rozczarowanie spowodowane niską jakością pamięta się długo po przeminięciu radości spowodowanej niską ceną"


Chmurka.pl

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67