projects
/
banana.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Integrates the PGP support with the web interface.
[banana.git]
/
banana
/
banana.inc.php.in
diff --git
a/banana/banana.inc.php.in
b/banana/banana.inc.php.in
index
df16d8b
..
386e4c1
100644
(file)
--- a/
banana/banana.inc.php.in
+++ b/
banana/banana.inc.php.in
@@
-26,6
+26,7
@@
class Banana
'autoup' => 1);
static public $boxpattern;
static public $withtabs = true;
'autoup' => 1);
static public $boxpattern;
static public $withtabs = true;
+ static public $baseurl = null;
static public $mimeparts = array();
### Spool ###
static public $mimeparts = array();
### Spool ###
@@
-53,6
+54,11
@@
class Banana
static public $msgshow_externalimages = false;
static public $msgshow_hasextimages = false;
static public $msgshow_withthread = true;
static public $msgshow_externalimages = false;
static public $msgshow_hasextimages = false;
static public $msgshow_withthread = true;
+ static public $msgshow_javascript = true;
+
+ static public $msgshow_pgpcheck = true;
+ static public $msgshow_pgppath = 'gpg';
+ static public $msgshow_pgpoptions = '';
/** Match an url
* Should be included in a regexp delimited using /, !, , or @ (eg: "/$url_regexp/ui")
/** Match an url
* Should be included in a regexp delimited using /, !, , or @ (eg: "/$url_regexp/ui")
@@
-65,7
+71,7
@@
class Banana
* $matches[2] = "http://www.polytechnique.org"
* $matches[3] = "]"
*/
* $matches[2] = "http://www.polytechnique.org"
* $matches[3] = "]"
*/
- static public $msgshow_url = '(["\[
])?((?:[a-z]+:\/\/|www\.)(?:[\.\,\;\!\:]*[a-z\@0-9~%$£µ&i#\-+=_\/\?]+)+)(["\]
])?';
+ static public $msgshow_url = '(["\[
\<])?((?:[a-z]+:\/\/|www\.)(?:[\.\,\;\!\:]*[a-z\@0-9~%$£µ&i#\-+=_\/\?]+)+)(["\]\>
])?';
### Message edition ###
static public $msgedit_canattach = true;
### Message edition ###
static public $msgedit_canattach = true;
@@
-191,6
+197,11
@@
class Banana
*/
protected function loadParams()
{
*/
protected function loadParams()
{
+ foreach ($this->params as &$value) {
+ if ($value === "") {
+ $value = null;
+ }
+ }
Banana::$group = isset($this->params['group']) ? $this->params['group'] : null;
Banana::$artid = isset($this->params['artid']) ? $this->params['artid'] : null;
Banana::$first = isset($this->params['first']) ? $this->params['first'] : null;
Banana::$group = isset($this->params['group']) ? $this->params['group'] : null;
Banana::$artid = isset($this->params['artid']) ? $this->params['artid'] : null;
Banana::$first = isset($this->params['first']) ? $this->params['first'] : null;
@@
-497,9
+508,9
@@
class Banana
$hdr_values[$header] = str_replace(', ', ',', $hdr_values[$header]);
}
}
$hdr_values[$header] = str_replace(', ', ',', $hdr_values[$header]);
}
}
- if (
$artid
) {
+ if (
!is_null($artid)
) {
$old =& $this->loadMessage($group, $artid);
$old =& $this->loadMessage($group, $artid);
- $hdr_values['References'] = $old->getHeaderValue('references') . $old->getHeaderValue('message-id');
+ $hdr_values['References'] = $old->getHeaderValue('references') .
' ' .
$old->getHeaderValue('message-id');
}
$msg = null;
if (isset($_POST['body']) && !is_utf8($_POST['body'])) {
}
$msg = null;
if (isset($_POST['body']) && !is_utf8($_POST['body'])) {
@@
-507,8
+518,8
@@
class Banana
}
if (empty($hdr_values['Subject'])) {
Banana::$page->trig(_b_('Le message doit avoir un sujet'));
}
if (empty($hdr_values['Subject'])) {
Banana::$page->trig(_b_('Le message doit avoir un sujet'));
- } elseif (Banana::$msgedit_canattach && isset($_FILES['attachment'])) {
- $uploaded = $_FILES['attachment'];
+ } elseif (Banana::$msgedit_canattach && isset($_FILES['attachment'])
&& $_FILES['attachment']['name']
) {
+ $uploaded =
&
$_FILES['attachment'];
if (!is_uploaded_file($uploaded['tmp_name'])) {
Banana::$page->trig(_b_('Une erreur est survenue lors du téléchargement du fichier'));
} else {
if (!is_uploaded_file($uploaded['tmp_name'])) {
Banana::$page->trig(_b_('Une erreur est survenue lors du téléchargement du fichier'));
} else {
@@
-522,9
+533,10
@@
class Banana
$this->loadSpool($group);
$newid = Banana::$spool->updateUnread(Banana::$profile['lastnews']);
Banana::$page->redirect(array('group' => $group, 'artid' => $newid ? $newid : $artid));
$this->loadSpool($group);
$newid = Banana::$spool->updateUnread(Banana::$profile['lastnews']);
Banana::$page->redirect(array('group' => $group, 'artid' => $newid ? $newid : $artid));
- }
- Banana::$page->trig(_b_('Une erreur est survenue lors de l\'envoi du message :') . '<br />'
+ }
else {
+
Banana::$page->trig(_b_('Une erreur est survenue lors de l\'envoi du message :') . '<br />'
. Banana::$protocole->lastError());
. Banana::$protocole->lastError());
+ }
}
} else {
if (!is_null($artid)) {
}
} else {
if (!is_null($artid)) {