<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.imap-get-quotaroot" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>imap_get_quotaroot</refname>
  <refpurpose>Retrieve the quota settings per user</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>array</type><methodname>imap_get_quotaroot</methodname>
   <methodparam><type>resource</type><parameter>imap_stream</parameter></methodparam>
   <methodparam><type>string</type><parameter>quota_root</parameter></methodparam>
  </methodsynopsis>
  <para>
   Retrieve the quota settings per user. The limit value represents the total
   amount of space allowed for this user's total mailbox usage.  The usage
   value represents the user's current total mailbox capacity.  
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    &imap.imap-stream.description;
    <varlistentry>
     <term><parameter>quota_root</parameter></term>
     <listitem>
      <para>
       <parameter>quota_root</parameter> should normally be in the form of
       which mailbox (i.e. INBOX).
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns an array of integer values pertaining to the specified user
   mailbox.  All values contain a key based upon the resource name, and a
   corresponding array with the usage and limit values within.
  </para>
  <para>
   This function will return &false; in the case of call failure, and an
   array of information about the connection upon an un-parsable response
   from the server.
  </para>
 </refsect1>
 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>imap_get_quotaroot</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php
$mbox = imap_open("{imap.example.org}", "kalowsky", "password", OP_HALFOPEN)
      or die("can't connect: " . imap_last_error());

$quota = imap_get_quotaroot($mbox, "INBOX");
if (is_array($quota)) {
   $storage = $quota_values['STORAGE'];
   echo "STORAGE usage level is: " .  $storage['usage'];
   echo "STORAGE limit level is: " .  $storage['limit'];

   $message = $quota_values['MESSAGE'];
   echo "MESSAGE usage level is: " .  $message['usage'];
   echo "MESSAGE limit level is: " .  $message['limit'];

   /* ...  */

}

imap_close($mbox);
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>
 <refsect1 role="notes">
  &reftitle.notes;
  <para>
   This function is currently only available to users of the c-client2000
   or greater library.
  </para>
  <para>
   The <parameter>imap_stream</parameter> should be opened as the user whose
   mailbox you wish to check.
  </para>
 </refsect1>
 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>imap_open</function></member>
    <member><function>imap_set_quota</function></member>
    <member><function>imap_get_quota</function></member>
   </simplelist>
  </para>
 </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->