diff --git a/README.md b/README.md new file mode 100644 index 0000000..19af174 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +

Patches

+ + diff --git a/fnord-trailing-slash.patch b/fnord-trailing-slash.patch new file mode 100644 index 0000000..c36a56a --- /dev/null +++ b/fnord-trailing-slash.patch @@ -0,0 +1,30 @@ +--- httpd.c 23 Mar 2006 01:35:03 -0000 1.92 ++++ httpd.c 5 Aug 2006 19:08:00 -0000 +@@ -834,6 +834,7 @@ + int fd=-1; + char* accept; + time_t ims; ++ char* furl=url; + while (url[0]=='/') ++url; + getmimetype(url,explicit); + { +@@ -856,8 +857,17 @@ + } + if ((fd=open(url,O_RDONLY))>=0) { + if (fstat(fd,&st)) goto bad; +- /* no directories */ +- if (S_ISDIR(st.st_mode)) goto bad; ++ /* no directories: redirect to url + '/' */ ++ if (S_ISDIR(st.st_mode)) { ++ if (fd>=0) close(fd); ++ redirectboilerplate(); ++ buffer_put(buffer_1,furl,strlen(furl)); ++ buffer_puts(buffer_1,"/\r\n\r\n"); ++ retcode=301; ++ dolog(0); ++ buffer_flush(buffer_1); ++ exit(0); ++ } + /* see if the peer accepts MIME type */ + /* see if the document has been changed */ + ims=parsedate(header(buf,buflen,"If-Modified-Since")); diff --git a/mutt-1.5.16-imap_complete_hosts.patch b/mutt-1.5.16-imap_complete_hosts.patch new file mode 100644 index 0000000..693be06 --- /dev/null +++ b/mutt-1.5.16-imap_complete_hosts.patch @@ -0,0 +1,12 @@ +diff -r 7df563e4b7fd imap/imap.c +--- a/imap/imap.c Tue Sep 04 17:22:59 2007 -0700 ++++ b/imap/imap.c Wed Sep 05 00:40:46 2007 -0700 +@@ -1866,7 +1866,7 @@ imap_complete_hosts (char *dest, size_t + int matchlen; + + matchlen = mutt_strlen (dest); +- for (mailbox = Incoming; mailbox && mailbox->next; mailbox = mailbox->next) ++ for (mailbox = Incoming; mailbox; mailbox = mailbox->next) + { + if (!mutt_strncmp (dest, mailbox->path, matchlen)) + { diff --git a/scuttle-admin.diff b/scuttle-admin.diff new file mode 100644 index 0000000..ea6cbc1 --- /dev/null +++ b/scuttle-admin.diff @@ -0,0 +1,253 @@ +Index: services/tagservice.php +=================================================================== +--- services/tagservice.php (revision 4) ++++ services/tagservice.php (working copy) +@@ -138,6 +138,25 @@ + return true; + } + ++ function deleteTagsForUser($uId) { ++ $qmask = 'DELETE FROM %s USING %s, %s WHERE %s.bId = %s.bId AND %s.uId = %d'; ++ $query = sprintf($qmask, ++ $this->getTableName(), ++ $this->getTableName(), ++ $GLOBALS['tableprefix'].'bookmarks', ++ $this->getTableName(), ++ $GLOBALS['tableprefix'].'bookmarks', ++ $GLOBALS['tableprefix'].'bookmarks', ++ $uId); ++ ++ if (!($dbresult =& $this->db->sql_query($query))) { ++ message_die(GENERAL_ERROR, 'Could not delete tags', '', __LINE__, __FILE__, $query, $this->db); ++ return false; ++ } ++ ++ return true; ++ } ++ + function &getTagsForBookmark($bookmarkid) { + if (!is_int($bookmarkid)) { + message_die(GENERAL_ERROR, 'Could not get tags (invalid bookmarkid)', '', __LINE__, __FILE__, $query); +Index: services/userservice.php +=================================================================== +--- services/userservice.php (revision 4) ++++ services/userservice.php (working copy) +@@ -126,7 +126,13 @@ + } + + function isAdmin($userid) { +- return false; //not implemented yet ++ if ( ($userinfo = $this->getUser($userid)) ) { ++ if ( $userinfo['uAdmin'] == 1 ) { ++ return true; ++ } ++ } ++ ++ return false; + } + + function getCurrentUserId() { +@@ -340,6 +346,17 @@ + return true; + } + ++ function deleteUser($uId) { ++ $query = 'DELETE FROM '. $this->getTableName() .' WHERE uId = '. intval($uId); ++ ++ if (!($dbresult = & $this->db->sql_query($query))) { ++ message_die(GENERAL_ERROR, 'Could not delete user', '', __LINE__, __FILE__, $query, $this->db); ++ return false; ++ } ++ ++ return true; ++ } ++ + function sanitisePassword($password) { + return sha1(trim($password)); + } +@@ -421,6 +446,23 @@ + } + } + ++ function getAllUsers ( ) { ++ $query = 'SELECT * FROM '. $this->getTableName(); ++ ++ if (! ($dbresult =& $this->db->sql_query($query)) ) { ++ message_die(GENERAL_ERROR, 'Could not get users', '', __LINE__, __FILE__, $query, $this->db); ++ return false; ++ } ++ ++ $rows = array(); ++ ++ while ( $row = $this->db->sql_fetchrow($dbresult) ) { ++ $rows[] = $row; ++ } ++ ++ return $rows; ++ } ++ + // Properties + function getTableName() { return $this->tablename; } + function setTableName($value) { $this->tablename = $value; } +Index: services/bookmarkservice.php +=================================================================== +--- services/bookmarkservice.php (revision 4) ++++ services/bookmarkservice.php (working copy) +@@ -385,6 +385,17 @@ + return true; + } + ++ function deleteBookmarksForUser($uId) { ++ $query = 'DELETE FROM '. $GLOBALS['tableprefix'] .'bookmarks WHERE uId = '. intval($uId); ++ ++ if (!($dbresult = & $this->db->sql_query($query))) { ++ message_die(GENERAL_ERROR, 'Could not delete bookmarks', '', __LINE__, __FILE__, $query, $this->db); ++ return false; ++ } ++ ++ return true; ++ } ++ + function countOthers($address) { + if (!$address) { + return false; +Index: admin.php +=================================================================== +--- admin.php (revision 0) ++++ admin.php (revision 0) +@@ -0,0 +1,81 @@ ++isLoggedOn() ) { ++ header('Location: '. createURL('login', '')); ++ exit(); ++} ++ ++$currentUser = $userservice->getCurrentUser(); ++$currentUserID = $userservice->getCurrentUserId(); ++$currentUsername = $currentUser[$userservice->getFieldName('username')]; ++ ++if ( !$userservice->isAdmin($currentUserID) ) { ++ header('Location: '. createURL('bookmarks', $currentUsername)); ++ exit(); ++} ++ ++@list($url, $action, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL; ++ ++if ( $action ) { ++ switch ( $action ) { ++ case 'delete': ++ if ( $user && ($userinfo = $userservice->getUserByUsername($user)) ) { ++ $uId = $userinfo['uId']; ++ ++ $userservice->deleteUser($uId); ++ $tagservice->deleteTagsForUser($uId); ++ // XXX: don't delete bookmarks before tags, else tags can't be deleted !!! ++ $bookmarkservice->deleteBookmarksForUser($uId); ++ ++ $tplVars['msg'] = sprintf(T_('%s and all his bookmarks and tags were deleted.'), $user); ++ } ++ break; ++ default: ++ // DO NOTHING ++ } ++} ++ ++$templatename = 'userlist.tpl'; ++$users =& $userservice->getAllUsers(); ++ ++if ( !is_array($users) ) { ++ $users = array(); ++} ++ ++$tplVars['users'] =& $users; ++ ++$templateservice->loadTemplate($templatename, $tplVars); ++ ++?> +Index: templates/userlist.tpl.php +=================================================================== +--- templates/userlist.tpl.php (revision 0) ++++ templates/userlist.tpl.php (revision 0) +@@ -0,0 +1,27 @@ ++includeTemplate($GLOBALS['top_include']); ++ ++echo '
    '; ++ ++foreach(array_keys($users) as $key) { ++ ++ echo '
  1. '."\n"; ++ ++ echo ''; ++ ++ echo '
    '; ++ echo ''.T_('Delete').''; ++ echo '
    '; ++ ++ echo '
  2. '."\n"; ++} ++ ++$this->includeTemplate('sidebar.tpl'); ++$this->includeTemplate($GLOBALS['bottom_include']); ++ ++?> +Index: templates/toolbar.inc.php +=================================================================== +--- templates/toolbar.inc.php (revision 4) ++++ templates/toolbar.inc.php (working copy) +@@ -3,9 +3,17 @@ + if ($userservice->isLoggedOn()) { + $cUser = $userservice->getCurrentUser(); + $cUsername = $cUser[$userservice->getFieldName('username')]; ++ $isAdmin = $userservice->isAdmin($cUser[$userservice->getFieldname('primary')]); + ?> + +