Esempio n. 1
0
    // todo_ornot: actually write something and read it back.
    echo $IND . "Data dir OK.<br />\n";
}
if ($data_dir == $attachment_dir) {
    echo $IND . "Attachment dir is the same as data dir.<br />\n";
    if (isset($data_dir_error)) {
        do_err($data_dir_error);
    }
} else {
    if (!file_exists($attachment_dir)) {
        do_err("Attachment dir ({$attachment_dir}) does not exist!");
    }
    if (!is_dir($attachment_dir)) {
        do_err("Attachment dir ({$attachment_dir}) is not a directory!");
    }
    if (!sq_is_writable($attachment_dir)) {
        do_err("I cannot write to attachment dir ({$attachment_dir})!");
    }
    echo $IND . "Attachment dir OK.<br />\n";
}
echo "Checking plugins...<br />\n";
/* check plugins and themes */
//FIXME: check requirements given in plugin _info() function, such as required PHP extensions, Pear packages, other plugins, SM version, etc see development docs for list of returned info from that function
//FIXME: update this list with most recent contents of the Obsolete category - I think it has changed recently
$bad_plugins = array('attachment_common', 'auto_prune_sent', 'compose_new_window', 'delete_move_next', 'disk_quota', 'email_priority', 'emoticons', 'focus_change', 'folder_settings', 'global_sql_addressbook', 'hancock', 'msg_flags', 'message_source', 'motd', 'paginator', 'printer_friendly', 'procfilter', 'redhat_php_cgi_fix', 'send_to_semicolon', 'spamassassin', 'sqcalendar', 'sqclock', 'sql_squirrel_logger', 'tmda', 'vacation', 'view_as_html', 'xmailer');
if (isset($plugins[0])) {
    foreach ($plugins as $plugin) {
        if (!file_exists(SM_PATH . 'plugins/' . $plugin)) {
            do_err('You have enabled the <i>' . $plugin . '</i> plugin, but I cannot find it.', FALSE);
        } elseif (!is_readable(SM_PATH . 'plugins/' . $plugin . '/setup.php')) {
            do_err('You have enabled the <i>' . $plugin . '</i> plugin, but I cannot locate or read its setup.php file.', FALSE);
Esempio n. 2
0
 /**
  * Open the addressbook file and store the file pointer.
  * Use $file as the file to open, or the class' own
  * filename property. If $param is empty and file is
  * open, do nothing.
  * @param bool $new is file already opened
  * @return bool
  */
 function open($new = false)
 {
     $this->error = '';
     $file = $this->filename;
     $create = $this->create;
     $fopenmode = $this->writeable && sq_is_writable($file) ? 'a+' : 'r';
     /* Return true is file is open and $new is unset */
     if ($this->filehandle && !$new) {
         return true;
     }
     /* Check that new file exitsts */
     if (!(file_exists($file) && is_readable($file)) && !$create) {
         return $this->set_error("{$file}: " . _("No such file or directory"));
     }
     /* Close old file, if any */
     if ($this->filehandle) {
         $this->close();
     }
     umask($this->umask);
     if (!$this->detect_writeable) {
         $fh = @fopen($file, $fopenmode);
         if ($fh) {
             $this->filehandle =& $fh;
             $this->filename = $file;
         } else {
             return $this->set_error("{$file}: " . _("Open failed"));
         }
     } else {
         /* Open file. First try to open for reading and writing,
          * but fall back to read only. */
         $fh = @fopen($file, 'a+');
         if ($fh) {
             $this->filehandle =& $fh;
             $this->filename = $file;
             $this->writeable = true;
         } else {
             $fh = @fopen($file, 'r');
             if ($fh) {
                 $this->filehandle =& $fh;
                 $this->filename = $file;
                 $this->writeable = false;
             } else {
                 return $this->set_error("{$file}: " . _("Open failed"));
             }
         }
     }
     return true;
 }