<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.oci8.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'function.oci-password-change.php',
    1 => 'oci_password_change',
    2 => 'Changes password of Oracle\'s user',
  ),
  'up' => 
  array (
    0 => 'ref.oci8.php',
    1 => 'OCI8 İşlevleri',
  ),
  'prev' => 
  array (
    0 => 'function.oci-parse.php',
    1 => 'oci_parse',
  ),
  'next' => 
  array (
    0 => 'function.oci-pconnect.php',
    1 => 'oci_pconnect',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/oci8/functions/oci-password-change.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.oci-password-change" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">oci_password_change</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8, PECL OCI8 &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">oci_password_change</span> &mdash; <span class="dc-title">Changes password of Oracle&#039;s user</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.oci-password-change-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>oci_password_change</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$connection</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$username</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$old_password</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$new_password</code></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <div class="methodsynopsis dc-description"><span class="methodname"><strong>oci_password_change</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$database_name</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$username</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$old_password</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$new_password</code></span><br>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="para rdfs-comment">
   Changes password for user with <code class="parameter">username</code>.
  </p>
  <p class="para">
   The <span class="function"><strong>oci_password_change()</strong></span> function is most useful for PHP command-line scripts,
   or when non-persistent connections are used throughout the PHP application.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.oci-password-change-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">connection</code></dt>
     <dd>
      <p class="para">
       An Oracle connection identifier, returned by 
       <span class="function"><a href="function.oci-connect.php" class="function">oci_connect()</a></span> or <span class="function"><a href="function.oci-pconnect.php" class="function">oci_pconnect()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">username</code></dt>
     <dd>
      <p class="para">
       The Oracle user name.
      </p>
     </dd>
    
    
     <dt><code class="parameter">old_password</code></dt>
     <dd>
      <p class="para">
       The old password.
      </p>
     </dd>
    
    
     <dt><code class="parameter">new_password</code></dt>
     <dd>
      <p class="para">
       The new password to be set.
      </p>
     </dd>
    
    
     <dt><code class="parameter">database_name</code></dt>
     <dd>
      <p class="para">
       The database name.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.oci-password-change-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="para">
   When <code class="parameter">database_name</code> is provided, <span class="function"><strong>oci_password_change()</strong></span> returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success,
    başarısızlık durumunda <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> döner. When <code class="parameter">connection</code> is provided, <span class="function"><strong>oci_password_change()</strong></span> returns
   the connection resource on success, başarısızlık durumunda <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> döner.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.oci-password-change-examples">
  <h3 class="title">Örnekler</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Örnek 1 <span class="function"><strong>oci_password_change()</strong></span> example changing the password of an already connected user</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$dbase      </span><span style="color: #007700">= </span><span style="color: #DD0000">'localhost/orcl'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$user       </span><span style="color: #007700">= </span><span style="color: #DD0000">'cj'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$current_pw </span><span style="color: #007700">= </span><span style="color: #DD0000">'welcome'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$new_pw     </span><span style="color: #007700">= </span><span style="color: #DD0000">'geelong'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$c </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_pconnect</span><span style="color: #007700">(</span><span style="color: #0000BB">$user</span><span style="color: #007700">, </span><span style="color: #0000BB">$current_pw</span><span style="color: #007700">, </span><span style="color: #0000BB">$dbase</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">oci_password_change</span><span style="color: #007700">(</span><span style="color: #0000BB">$c</span><span style="color: #007700">, </span><span style="color: #0000BB">$user</span><span style="color: #007700">, </span><span style="color: #0000BB">$current_pw</span><span style="color: #007700">, </span><span style="color: #0000BB">$new_pw</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"New password is : " </span><span style="color: #007700">. </span><span style="color: #0000BB">$new_pw </span><span style="color: #007700">. </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Örnek 2 <span class="function"><strong>oci_password_change()</strong></span> example of connecting and changing the password in one step</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$dbase      </span><span style="color: #007700">= </span><span style="color: #DD0000">'localhost/orcl'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$user       </span><span style="color: #007700">= </span><span style="color: #DD0000">'cj'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$current_pw </span><span style="color: #007700">= </span><span style="color: #DD0000">'welcome'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$new_pw     </span><span style="color: #007700">= </span><span style="color: #DD0000">'geelong'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$c </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_pconnect</span><span style="color: #007700">(</span><span style="color: #0000BB">$user</span><span style="color: #007700">, </span><span style="color: #0000BB">$current_pw</span><span style="color: #007700">, </span><span style="color: #0000BB">$dbase</span><span style="color: #007700">);<br />if (!</span><span style="color: #0000BB">$c</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">$m </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_error</span><span style="color: #007700">();<br />    if (</span><span style="color: #0000BB">$m</span><span style="color: #007700">[</span><span style="color: #DD0000">'code'</span><span style="color: #007700">] == </span><span style="color: #0000BB">28001</span><span style="color: #007700">) { </span><span style="color: #FF8000">// "ORA-28001: the password has expired"<br />        // Login and reset password at the same time<br />        </span><span style="color: #0000BB">$c </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_password_change</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbase</span><span style="color: #007700">, </span><span style="color: #0000BB">$user</span><span style="color: #007700">, </span><span style="color: #0000BB">$current_pw</span><span style="color: #007700">, </span><span style="color: #0000BB">$new_pw</span><span style="color: #007700">);<br />        if (</span><span style="color: #0000BB">$c</span><span style="color: #007700">) {<br />            echo </span><span style="color: #DD0000">"New password is : " </span><span style="color: #007700">. </span><span style="color: #0000BB">$new_pw </span><span style="color: #007700">. </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />        }<br />    }<br />}<br /><br />if (!</span><span style="color: #0000BB">$c</span><span style="color: #007700">) {  </span><span style="color: #FF8000">// The original error wasn't 28001, or the password change failed<br />    </span><span style="color: #0000BB">$m </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_error</span><span style="color: #007700">();<br />    </span><span style="color: #0000BB">trigger_error</span><span style="color: #007700">(</span><span style="color: #DD0000">'Could not connect to database: '</span><span style="color: #007700">. </span><span style="color: #0000BB">$m</span><span style="color: #007700">[</span><span style="color: #DD0000">'message'</span><span style="color: #007700">], </span><span style="color: #0000BB">E_USER_ERROR</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #FF8000">// Use the connection $c<br />// ...<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.oci-password-change-notes">
  <h3 class="title">Notlar</h3>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
   <p class="para">
    Changing the password either with this function or directly in
    Oracle should be done carefully.  This is because PHP applications
    may continue to successfully reuse persistent connections by
    authenticating with the old password.  The best practice is to
    restart all web servers whenever the user password is changed.
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
   <p class="para">
    If upgrading the Oracle client libraries or the database from a release prior to 11.2.0.3
    to version 11.2.0.3 or higher, <span class="function"><strong>oci_password_change()</strong></span> may give the
    error &quot;ORA-1017: invalid username/password&quot; unless both client and server versions are upgraded at
    the same time.
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
   <p class="para">
    The second <span class="function"><strong>oci_password_change()</strong></span> syntax is available
    since OCI8 version 1.1.
   </p>
  </p></blockquote>
 </div>


</div><?php manual_footer($setup); ?>