[ Index ]
 

Code source de Serendipity 1.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/include/admin/ -> installer.inc.php (source)

   1  <?php # $Id: installer.inc.php 1816 2007-08-06 10:18:39Z garvinhicking $
   2  # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
   3  # All rights reserved.  See LICENSE file for licensing details
   4  
   5  if (IN_serendipity !== true) {
   6      die ("Don't hack!");
   7  }
   8  
   9  umask(0000);
  10  $umask = 0775;
  11  @define('IN_installer', true);
  12  
  13  define('S9Y_I_ERROR', -1);
  14  define('S9Y_I_WARNING', 0);
  15  define('S9Y_I_SUCCESS', 1);
  16  
  17  if (defined('S9Y_DATA_PATH')) {
  18      // Shared installation. S9Y_INCLUDE_PATH points to repository,
  19      // S9Y_DATA_PATH points to the local directory.
  20      $basedir = S9Y_DATA_PATH;
  21  } else {
  22      // Usual installation within DOCUMENT_ROOT.
  23      $basedir = serendipity_query_default('serendipityPath', false);
  24  }
  25  
  26  /**
  27   * Checks a return code constant if it's successfull or an error and return HTML code
  28   *
  29   * The diagnosis checks return codes of several PHP checks. Depending
  30   * on the input, a specially formatted string is returned.
  31   *
  32   * @access public
  33   * @param  int      Return code
  34   * @param  string   String to return wrapped in special HTML markup
  35   * @return string   returned String
  36   */
  37  function serendipity_installerResultDiagnose($result, $s) {
  38      global $errorCount;
  39      if ( $result === S9Y_I_SUCCESS ) {
  40          return '<span style="color: green; font-weight: bold">'. $s .'</span>';
  41      }
  42      if ( $result === S9Y_I_WARNING ) {
  43          return '<span style="color: orange; font-weight: bold">'. $s .' [?]</span>';
  44      }
  45      if ( $result === S9Y_I_ERROR ) {
  46          $errorCount++;
  47          return '<span style="color: red; font-weight: bold">'. $s .' [!]</span>';
  48      }
  49  }
  50  
  51  /* If register_globals is enabled and we use the dual GET/POST submission method, we will
  52     receive the value of the POST-variable inside the GET-variable, which is of course unwanted.
  53     Thus we transfer a new variable GETSTEP via POST and set that to an internal GET value. */
  54  if (!empty($serendipity['POST']['getstep']) && is_numeric($serendipity['POST']['getstep'])) {
  55      $serendipity['GET']['step'] = $serendipity['POST']['getstep'];
  56  }
  57  
  58  /* From configuration to install */
  59  if ( sizeof($_POST) > 1 && $serendipity['GET']['step'] == 3 ) {
  60      /* One problem, if the user chose to do an easy install, not all config vars has been transfered
  61         Therefore we fetch all config vars with their default values, and merge them with our POST data */
  62  
  63      $config = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE);
  64      foreach ( $config as $category ) {
  65          foreach ( $category['items'] as $item ) {
  66              if ( !isset($_POST[$item['var']]) ) {
  67                  $_POST[$item['var']] = serendipity_query_default($item['var'], $item['default']);
  68              }
  69          }
  70      }
  71  
  72      if ( is_array($errors = serendipity_checkInstallation()) ) {
  73          foreach ( $errors as  $error ) {
  74              echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />'. $error .'</div>';
  75          }
  76  
  77          $from = $_POST;
  78          /* Back to configuration, user did something wrong */
  79          $serendipity['GET']['step'] = $serendipity['POST']['step'];
  80      } else {
  81          /* We're good, move to install process */
  82          $serendipity['GET']['step'] = 3;
  83      }
  84  }
  85  
  86  if ( (int)$serendipity['GET']['step'] == 0 ) {
  87  ?>
  88  <?php echo WELCOME_TO_INSTALLATION ?>.
  89  <br /><?php echo FIRST_WE_TAKE_A_LOOK ?>.
  90  <br /><?php echo sprintf(ERRORS_ARE_DISPLAYED_IN, serendipity_installerResultDiagnose(S9Y_I_ERROR, RED), serendipity_installerResultDiagnose(S9Y_I_WARNING, YELLOW), serendipity_installerResultDiagnose(S9Y_I_SUCCESS, GREEN)); ?>.
  91  <br />
  92  <br>
  93  <div align="center">- <?php echo sprintf(PRE_INSTALLATION_REPORT, $serendipity['version']) ?> -</div><br />
  94  
  95  
  96  <?php $errorCount = 0 ?>
  97  <div align="center">
  98  <table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
  99      <tr>
 100          <td colspan="2" style="font-weight: bold"><?php echo PHP_INSTALLATION ?></td>
 101      </tr>
 102      <tr>
 103        <td><?php echo OPERATING_SYSTEM ?></td>
 104        <td><?php echo php_uname('s') .' '. php_uname('r') .', '. php_uname('m') ?></td>
 105      </tr>
 106      <tr>
 107        <td><?php echo WEBSERVER_SAPI ?></td>
 108        <td><?php echo php_sapi_name() ?></td>
 109      </tr>
 110      <tr>
 111          <td>PHP version >= 4.1.2</td>
 112          <td width="200"><?php
 113              if ( version_compare(phpversion(), '4.1.2', '>=') ) {
 114                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES .', '. phpversion());
 115              } else {
 116                  echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NO);
 117              }
 118       ?></td>
 119      </tr>
 120      <tr>
 121          <td>Database extensions</td>
 122          <td width="200"><?php
 123  
 124              if ( sizeof(($_res = serendipity_probeInstallation('dbType'))) == 0 ) {
 125                  echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NONE);
 126              } else {
 127                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, implode(', ', $_res));
 128              }
 129       ?></td>
 130      </tr>
 131      <tr>
 132          <td>Session extension</td>
 133          <td width="200"><?php
 134              if ( extension_loaded('session') ) {
 135                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
 136              } else {
 137                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, NO);
 138              }
 139       ?></td>
 140      </tr>
 141      <tr>
 142          <td>PCRE extension</td>
 143          <td width="200"><?php
 144              if ( extension_loaded('pcre') ) {
 145                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
 146              } else {
 147                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, NO);
 148              }
 149       ?></td>
 150      </tr>
 151      <tr>
 152          <td>GDlib extension</td>
 153          <td width="200"><?php
 154              if ( extension_loaded('gd') ) {
 155                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
 156              } else {
 157                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
 158              }
 159       ?></td>
 160      </tr>
 161      <tr>
 162        <td>OpenSSL extension</td>
 163        <td><?php
 164              if ( extension_loaded('openssl') ) {
 165                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
 166              } else {
 167                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
 168              }
 169       ?></td>
 170      </tr>
 171      <tr>
 172          <td>mbstring extension</td>
 173          <td width="200"><?php
 174              if ( extension_loaded('mbstring') ) {
 175                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
 176              } else {
 177                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
 178              }
 179       ?></td>
 180      </tr>
 181      <tr>
 182          <td>iconv extension</td>
 183          <td width="200"><?php
 184              if ( extension_loaded('iconv') ) {
 185                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
 186              } else {
 187                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
 188              }
 189       ?></td>
 190      </tr>
 191      <tr>
 192          <td>zlib extension</td>
 193          <td width="200"><?php
 194              if ( extension_loaded('zlib') ) {
 195                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
 196              } else {
 197                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
 198              }
 199       ?></td>
 200      </tr>
 201      <tr>
 202        <td>Imagemagick binary </td>
 203        <td><?php
 204              if ($binary = serendipity_query_default('convert', false)) {
 205                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, $binary);
 206              } else {
 207                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NOT_FOUND);
 208              }
 209        ?></td>
 210      </tr>
 211  </table>
 212  <br />
 213  <table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
 214      <tr>
 215          <td colspan="3" style="font-weight: bold"><?PHP echo PHPINI_CONFIGURATION ?></td>
 216      </tr>
 217      <tr>
 218        <td>&nbsp;</td>
 219        <td width="150"><em><?php echo RECOMMENDED ?></em></td>
 220        <td width="150"><em><?php echo ACTUAL ?></em></td>
 221      </tr>
 222      <tr>
 223        <td>safe_mode</td>
 224        <td width="150"><strong><?php echo 'OFF' ?></strong></td>
 225        <td width="150"><?php
 226              if ( !serendipity_ini_bool(ini_get('safe_mode')) ) {
 227                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
 228              } else {
 229                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
 230              }
 231       ?></td>
 232      </tr>
 233      <tr>
 234          <td>register_globals</td>
 235          <td width="150"><strong><?php echo 'OFF' ?></strong></td>
 236          <td width="150"><?php
 237              if ( serendipity_ini_bool(ini_get('register_globals')) ) {
 238                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
 239              } else {
 240                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
 241              }
 242       ?></td>
 243      </tr>
 244      <tr>
 245          <td>magic_quotes_gpc</td>
 246          <td width="150"><strong><?php echo 'OFF' ?></strong></td>
 247          <td width="150"><?php
 248              if ( !serendipity_ini_bool(ini_get('magic_quotes_gpc')) ) {
 249                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
 250              } else {
 251                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
 252              }
 253       ?></td>
 254      </tr>
 255      <tr>
 256        <td>magic_quotes_runtime</td>
 257        <td width="150"><strong><?php echo 'OFF' ?></strong></td>
 258        <td width="150"><?php
 259              if ( !serendipity_ini_bool(ini_get('magic_quotes_runtime')) ) {
 260                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
 261              } else {
 262                  echo serendipity_installerResultDiagnose(S9Y_I_ERROR, 'ON');
 263              }
 264       ?></td>
 265      </tr>
 266      <tr>
 267        <td>session.use_trans_sid</td>
 268        <td width="150"><strong><?php echo 'OFF' ?></strong></td>
 269        <td width="150"><?php
 270              if ( !serendipity_ini_bool(ini_get('session.use_trans_sid')) ) {
 271                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
 272              } else {
 273                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
 274              }
 275       ?></td>
 276      </tr>
 277      <tr>
 278        <td>allow_url_fopen</td>
 279        <td width="150"><strong><?php echo 'ON' ?></strong></td>
 280        <td width="150"><?php
 281              if ( serendipity_ini_bool(ini_get('allow_url_fopen')) ) {
 282                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'ON');
 283              } else {
 284                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'OFF');
 285              }
 286       ?></td>
 287      </tr>
 288      <tr>
 289        <td>file_uploads</td>
 290        <td width="150"><strong><?php echo 'ON' ?></strong></td>
 291        <td width="150"><?php
 292              if ( serendipity_ini_bool(ini_get('file_uploads')) ) {
 293                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'ON');
 294              } else {
 295                  echo serendipity_installerResultDiagnose(S9Y_I_ERROR, 'OFF');
 296              }
 297       ?></td>
 298      </tr>
 299      <tr>
 300        <td>post_max_size</td>
 301        <td width="150"><strong>10M</strong></td>
 302        <td width="150"><?php
 303              if ( serendipity_ini_bytesize(ini_get('post_max_size')) >= (10*1024*1024) ) {
 304                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, ini_get('post_max_size'));
 305              } else {
 306                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, ini_get('post_max_size'));
 307              }
 308       ?></td>
 309      </tr>
 310      <tr>
 311        <td>upload_max_filesize</td>
 312        <td width="150"><strong>10M</strong></td>
 313        <td width="150"><?php
 314              if ( serendipity_ini_bytesize(ini_get('upload_max_filesize')) >= (10*1024*1024) ) {
 315                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, ini_get('upload_max_filesize'));
 316              } else {
 317                  echo serendipity_installerResultDiagnose(S9Y_I_WARNING, ini_get('upload_max_filesize'));
 318              }
 319       ?></td>
 320      </tr>
 321  </table>
 322  
 323  <br />
 324  <table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
 325      <tr>
 326          <td colspan="2" style="font-weight: bold"><?php echo PERMISSIONS ?></td>
 327      </tr>
 328      <tr>
 329          <td><?php echo $basedir ?></td>
 330          <td width="200"><?php
 331              $basewritable = False;
 332              if ( is_writable($basedir) ) {
 333                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
 334                  $basewritable = True;
 335              } else {
 336                  #Figure out if we already have all we need
 337                  #PATH_SMARTY_COMPILE/
 338                  #uploads/
 339                  #archives/
 340                  #.htaccess
 341                  #serendipity_config_local.inc.php
 342                  # For completeness we could test to make sure the directories
 343                  # really are directories, but that's probably overkill
 344                  foreach (array('archives/', PATH_SMARTY_COMPILE . '/', 'uploads/', '.htaccess', 'serendipity_config_local.inc.php') as $path) {
 345                      if (!is_writeable($basedir . $path)) {
 346                          echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
 347                          $showWritableNote = true;
 348                          break;
 349                      }
 350                  }
 351                  if (!$showWritableNote) {
 352                      echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
 353                  }
 354              }
 355       ?></td>
 356      </tr>
 357      <tr>
 358          <td><?php echo $basedir . PATH_SMARTY_COMPILE?></td>
 359          <td width="200"><?php
 360              if ( is_writable($basedir . PATH_SMARTY_COMPILE) ) {
 361                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
 362              } else {
 363                  if ($basewritable && !is_dir($basedir . PATH_SMARTY_COMPILE)) {
 364                      echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
 365                      #This directory will be created later in the process
 366                  } else {
 367                      echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
 368                      $showWritableNote = true;
 369                  }
 370              }
 371       ?></td>
 372      </tr>
 373      <tr>
 374          <td><?php echo $basedir . 'archives/'?></td>
 375          <td width="200"><?php
 376              if ( is_writable($basedir . 'archives/') ) {
 377                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
 378              } else {
 379                  if ($basewritable && !is_dir($basedir . 'archives/')) {
 380                      echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
 381                      #This directory will be created later in the process
 382                  } else {
 383                      echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
 384                      $showWritableNote = true;
 385                  }
 386              }
 387       ?></td>
 388      </tr>
 389  <?php if ( is_dir($basedir .'uploads/') ) { ?>
 390      <tr>
 391          <td><?php echo $basedir . 'uploads/'?></td>
 392          <td width="200"><?php
 393              if ( is_writable($basedir . 'uploads/') ) {
 394                  echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
 395              } else {
 396                  if ($basewritable && !is_dir($basedir . 'uploads/')) {
 397                      echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
 398                      #This directory will be created later in the process
 399                  } else {
 400                      echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
 401                      $showWritableNote = true;
 402                  }
 403              }
 404       ?></td>
 405      </tr>
 406  <?php } ?>
 407  <?php if (function_exists('is_executable')) { ?>
 408      <tr>
 409        <td>Execute Imagemagick  binary </td>
 410        <td><?php
 411              if ($binary = serendipity_query_default('convert', false)) {
 412                  if (is_executable($binary)) {
 413                      echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
 414                  } else {
 415                      echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
 416                  }
 417              } else {
 418                   echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NOT_FOUND);
 419              }
 420        ?></td>
 421      </tr>
 422  <?php } ?>
 423  </table>
 424  
 425  <?php if ( $showWritableNote === true ) { ?>
 426      <div class="serendipityAdminMsgNote"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_note.png'); ?>" alt="" /><?php echo sprintf(PROBLEM_PERMISSIONS_HOWTO, 'chmod 1777') ?></div>
 427  <?php } ?>
 428  
 429  <div align="center">
 430  <?php if ( $errorCount > 0 ) { ?>
 431      <div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_error.png'); ?>" alt="" /><?php echo PROBLEM_DIAGNOSTIC ?></div>
 432      <h2><a href="serendipity_admin.php"><?php echo RECHECK_INSTALLATION ?></a></h2>
 433  <?php } else { ?>
 434      <?php echo SELECT_INSTALLATION_TYPE ?>:
 435      <h2><a href="?serendipity[step]=2a"><?php echo SIMPLE_INSTALLATION ?></a> - <a href="?serendipity[step]=2b"><?php echo EXPERT_INSTALLATION ?></a></h2>
 436      <?php } ?>
 437  </div>
 438  </div>
 439  
 440  <?php } elseif ( $serendipity['GET']['step'] == '2a' ) { ?>
 441  <form action="?" method="post">
 442      <input type="hidden" name="serendipity[step]" value="<?php echo $serendipity['GET']['step'] ?>">
 443      <input type="hidden" name="serendipity[getstep]" value="3">
 444  <?php
 445      $config = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE, null, array('simpleInstall'));
 446      serendipity_printConfigTemplate($config, $from, true, false, false);
 447  ?>
 448      <div align="center"><input name="submit" type="submit" value="<?php echo COMPLETE_INSTALLATION ?>" class="serendipityPrettyButton input_button"></div>
 449  </form>
 450  
 451  <?php } elseif ( $serendipity['GET']['step'] == '2b' ) { ?>
 452  <form action="?" method="post">
 453      <input type="hidden" name="serendipity[step]" value="<?php echo $serendipity['GET']['step'] ?>">
 454      <input type="hidden" name="serendipity[getstep]" value="3">
 455  <?php
 456      $config = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE);
 457      serendipity_printConfigTemplate($config, $from, true, false, false);
 458  ?>
 459      <div align="center"><input name="submit" type="submit" value="<?php echo COMPLETE_INSTALLATION ?>" class="serendipityPrettyButton input_button"></div>
 460  </form>
 461  
 462  <?php } elseif ( (int)$serendipity['GET']['step'] == 3 ) { ?>
 463  <?php
 464  
 465      $serendipity['dbPrefix'] = $_POST['dbPrefix'];
 466  
 467      echo CHECK_DATABASE_EXISTS .'...';
 468      $t = serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}authors", false, 'both', false, false, false, true);
 469      if ( is_array($t) ) {
 470          echo ' <strong>'. THEY_DO .'</strong>, '. WONT_INSTALL_DB_AGAIN;
 471          echo '<br />';
 472          echo '<br />';
 473      } else {
 474          echo ' <strong>'. THEY_DONT .'</strong>';
 475          echo '<br />';
 476  
 477          echo CREATE_DATABASE;
 478          serendipity_installDatabase();
 479          echo ' <strong>' . DONE . '</strong><br />';
 480  
 481          echo sprintf(CREATING_PRIMARY_AUTHOR, $_POST['user']) .'...';
 482          $authorid = serendipity_addAuthor($_POST['user'], $_POST['pass'], $_POST['realname'], $_POST['email'], USERLEVEL_ADMIN);
 483          $mail_comments =  (serendipity_db_bool($_POST['want_mail']) ? 1 : 0);
 484          serendipity_set_user_var('mail_comments', $mail_comments, $authorid);
 485          serendipity_set_user_var('mail_trackbacks', $mail_comments, $authorid);
 486          serendipity_set_user_var('right_publish', 1, $authorid);
 487          serendipity_addDefaultGroup('USERLEVEL_EDITOR_DESC', USERLEVEL_EDITOR);
 488          serendipity_addDefaultGroup('USERLEVEL_CHIEF_DESC',  USERLEVEL_CHIEF);
 489          serendipity_addDefaultGroup('USERLEVEL_ADMIN_DESC',  USERLEVEL_ADMIN);
 490  
 491          echo ' <strong>' . DONE . '</strong><br />';
 492  
 493          echo SETTING_DEFAULT_TEMPLATE .'... ';
 494          serendipity_set_config_var('template', $serendipity['defaultTemplate']);
 495          echo ' <strong>' . DONE . '</strong><br />';
 496  
 497          echo INSTALLING_DEFAULT_PLUGINS .'... ';
 498          include_once  S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php';
 499          serendipity_plugin_api::register_default_plugins();
 500          echo ' <strong>' . DONE . '</strong><br />';
 501  
 502      }
 503  
 504      echo sprintf(ATTEMPT_WRITE_FILE, '.htaccess') . '... ';
 505      $errors = serendipity_installFiles($basedir);
 506      if ( $errors === true ) {
 507           echo ' <strong>' . DONE . '</strong><br />';
 508      } else {
 509          echo ' <strong>' . FAILED . '</strong><br />';
 510          foreach ( $errors as $error ) {
 511              echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . $error .'</div>';
 512          }
 513      }
 514  
 515      if ( serendipity_updateConfiguration() ) {
 516          echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png'). '" alt="" />' . SERENDIPITY_INSTALLED .'</div>';
 517          echo '<div align="center" style="font-size: large"><a href="'. $_POST['serendipityHTTPPath'] .'">'. VISIT_BLOG_HERE .'</a></div>';
 518          echo '<div align="center">'. THANK_YOU_FOR_CHOOSING .'</div>';
 519      } else {
 520          echo '<div class="serendipityAdminMsgError"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />'. ERROR_DETECTED_IN_INSTALL .'</div>';
 521      }
 522  }
 523  
 524  /* vim: set sts=4 ts=4 expandtab : */


Généré le : Sat Nov 24 09:00:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics