Source for file folders_rename_getname.php

Documentation is available at folders_rename_getname.php

  1. <?php
  2.  
  3. /**
  4.  * folders_rename_getname.php
  5.  *
  6.  * Gets folder names and enables renaming
  7.  * Called from folders.php
  8.  *
  9.  * @copyright 1999-2014 The SquirrelMail Project Team
  10.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  11.  * @version $Id: folders_rename_getname.php 14422 2014-01-01 20:59:43Z pdontthink $
  12.  * @package squirrelmail
  13.  */
  14.  
  15. /** This is the folders_rename_getname page */
  16. define('PAGE_NAME''folders_rename_getname');
  17.  
  18. /**
  19.  * Path for SquirrelMail required files.
  20.  * @ignore
  21.  */
  22. define('SM_PATH','../');
  23.  
  24. /* SquirrelMail required files. */
  25. require_once(SM_PATH 'include/validate.php');
  26. require_once(SM_PATH 'functions/global.php');
  27. require_once(SM_PATH 'functions/imap_mailbox.php');
  28. require_once(SM_PATH 'functions/html.php');
  29. require_once(SM_PATH 'functions/display_messages.php');
  30. require_once(SM_PATH 'functions/forms.php');
  31.  
  32. /* get globals we may need */
  33. sqgetGlobalVar('key',       $key,           SQ_COOKIE);
  34. sqgetGlobalVar('username',  $username,      SQ_SESSION);
  35. sqgetGlobalVar('onetimepad',$onetimepad,    SQ_SESSION);
  36. sqgetGlobalVar('delimiter'$delimiter,     SQ_SESSION);
  37. sqgetGlobalVar('old',       $old,           SQ_POST);
  38. /* end of get globals */
  39.  
  40. if ($old == ''{
  41.     displayPageHeader($color'None');
  42.  
  43.     plain_error_message(_("You have not selected a folder to rename. Please do so.").
  44.         '<br /><a href="../src/folders.php">'._("Click here to go back").'</a>.'$color);
  45.     exit;
  46. }
  47.  
  48. if (substr($oldstrlen($oldstrlen($delimiter)) == $delimiter{
  49.     $isfolder TRUE;
  50.     $old substr($old0strlen($old1);
  51. else {
  52.     $isfolder FALSE;
  53. }
  54.  
  55. $old imap_utf7_decode_local($old);
  56.  
  57. // displayable mailbox format is without folder prefix on front
  58. global $folder_prefix;
  59. if (substr($old0strlen($folder_prefix)) == $folder_prefix{
  60.     $displayable_old substr($oldstrlen($folder_prefix));
  61. else {
  62.     $displayable_old $old;
  63. }
  64.  
  65. if (strpos($displayable_old$delimiter)) {
  66.     $old_name substr($displayable_oldstrrpos($displayable_old$delimiter)+1);
  67.     $parent sm_encode_html_special_chars(substr($displayable_old
  68.                                       0
  69.                                       strrpos($displayable_old$delimiter))
  70.             . ' ' $delimiter);
  71. else {
  72.     $old_name $displayable_old;
  73.     $parent '';
  74. }
  75.  
  76.  
  77. displayPageHeader($color'None');
  78. echo '<br />' .
  79.     html_tag'table''''center''''width="95%" border="0"' .
  80.         html_tag'tr',
  81.             html_tag'td''<b>' _("Rename a folder"'</b>''center'$color[0)
  82.         .
  83.         html_tag'tr' .
  84.             html_tag'td''''center'$color[4.
  85.             addForm('folders_rename_do.php''post'''''''''TRUE).
  86.      _("New name:").
  87.      '<br /><b>'$parent '</b>'.
  88.      addInput('new_name'$old_name25'<br />' "\n";
  89. if $isfolder {
  90.     echo addHidden('isfolder''true');
  91. }
  92. echo addHidden('orig'$old).
  93.      addHidden('old_name'$old_name).
  94.      '<input type="submit" value="'._("Submit")."\" />\n".
  95.      '</form><br /></td></tr></table>';

Documentation generated on Sat, 20 Dec 2014 04:20:54 +0100 by phpDocumentor 1.4.3