Merge remote-tracking branch 'friendica/develop' into improvement/ping-php-json

This commit is contained in:
Hypolite Petovan 2016-11-22 21:14:25 -05:00
commit 133120007c
40 changed files with 9841 additions and 9771 deletions

34
Vagrantfile vendored
View file

@ -1,14 +1,16 @@
server_ip = "192.168.22.10"
server_ip_trusty = "192.168.22.10"
server_ip_xenial = "192.168.22.11"
server_memory = "1024" # MB
server_timezone = "UTC"
public_folder = "/vagrant"
Vagrant.configure(2) do |config|
######################################################################
# Set server to Ubuntu 14.04
config.vm.box = "ubuntu/trusty64"
config.vm.define "trusty" do |trusty|
trusty.vm.box = "ubuntu/trusty64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
@ -18,14 +20,36 @@ Vagrant.configure(2) do |config|
# Create a hostname, don't forget to put it to the `hosts` file
# This will point to the server's default virtual host
# TO DO: Make this work with virtualhost along-side xip.io URL
config.vm.hostname = "friendica.dev"
trusty.vm.hostname = "friendica-trusty.dev"
# Create a static IP
config.vm.network :private_network, ip: server_ip
trusty.vm.network :private_network, ip: server_ip_trusty
end
######################################################################
# Set server to Ubuntu 16.04
config.vm.define "xenial" do |xenial|
xenial.vm.box = "boxcutter/ubuntu1604"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a hostname, don't forget to put it to the `hosts` file
# This will point to the server's default virtual host
# TO DO: Make this work with virtualhost along-side xip.io URL
xenial.vm.hostname = "friendica-xenial.dev"
# Create a static IP
xenial.vm.network :private_network, ip: server_ip_xenial
end
######################################################################
# Share a folder between host and guest
config.vm.synced_folder "./", "/vagrant/", owner: "www-data", group: "vagrant"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
config.vm.provider "virtualbox" do |vb|

View file

@ -38,7 +38,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_CODENAME', 'Asparagus');
define ( 'FRIENDICA_VERSION', '3.5.1-dev' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1208 );
define ( 'DB_UPDATE_VERSION', 1209 );
/**
* @brief Constant with a HTML line break.
@ -609,6 +609,7 @@ class App {
$this->performance["markstart"] = microtime(true);
$this->callstack["database"] = array();
$this->callstack["database_write"] = array();
$this->callstack["network"] = array();
$this->callstack["file"] = array();
$this->callstack["rendering"] = array();

View file

@ -1,19 +0,0 @@
ALTER TABLE `profile` DROP INDEX `pub_keywords` ;
ALTER TABLE `profile` DROP INDEX `prv_keywords` ;
ALTER TABLE `item` DROP INDEX `title` ;
ALTER TABLE `item` DROP INDEX `body` ;
ALTER TABLE `item` DROP INDEX `allow_cid` ;
ALTER TABLE `item` DROP INDEX `allow_gid` ;
ALTER TABLE `item` DROP INDEX `deny_cid` ;
ALTER TABLE `item` DROP INDEX `deny_gid` ;
ALTER TABLE `item` DROP INDEX `tag` ;
ALTER TABLE `item` DROP INDEX `file` ;
SELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' engine=InnoDB;')
FROM information_schema.tables
WHERE engine = 'MyISAM';

View file

@ -1,6 +1,6 @@
-- ------------------------------------------
-- Friendica 3.5.1-dev (Asparagus)
-- DB_UPDATE_VERSION 1205
-- DB_UPDATE_VERSION 1208
-- ------------------------------------------
@ -59,7 +59,8 @@ CREATE TABLE IF NOT EXISTS `cache` (
`expire_mode` int(11) NOT NULL DEFAULT 0,
`updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY(`k`(191)),
INDEX `updated` (`updated`)
INDEX `updated` (`updated`),
INDEX `expire_mode_updated` (`expire_mode`,`updated`)
) DEFAULT CHARSET=utf8mb4;
--
@ -174,6 +175,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
`ffi_keyword_blacklist` mediumtext,
PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
INDEX `addr_uid` (`addr`,`uid`),
INDEX `nurl` (`nurl`)
) DEFAULT CHARSET=utf8mb4;
@ -201,7 +203,8 @@ CREATE TABLE IF NOT EXISTS `deliverq` (
`cmd` varchar(32) NOT NULL DEFAULT '',
`item` int(11) NOT NULL DEFAULT 0,
`contact` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`)
PRIMARY KEY(`id`),
UNIQUE INDEX `cmd_item_contact` (`cmd`,`item`,`contact`)
) DEFAULT CHARSET=utf8mb4;
--
@ -656,7 +659,7 @@ CREATE TABLE IF NOT EXISTS `notify` (
`verb` varchar(255) NOT NULL DEFAULT '',
`otype` varchar(16) NOT NULL DEFAULT '',
`name_cache` tinytext,
`msg_name` mediumtext,
`msg_cache` mediumtext,
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
) DEFAULT CHARSET=utf8mb4;
@ -739,7 +742,9 @@ CREATE TABLE IF NOT EXISTS `photo` (
`deny_cid` mediumtext,
`deny_gid` mediumtext,
PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
INDEX `uid_contactid` (`uid`,`contact-id`),
INDEX `uid_profile` (`uid`,`profile`),
INDEX `uid_album_created` (`uid`,`album`,`created`),
INDEX `resource-id` (`resource-id`),
INDEX `guid` (`guid`)
) DEFAULT CHARSET=utf8mb4;
@ -894,6 +899,7 @@ CREATE TABLE IF NOT EXISTS `register` (
`uid` int(11) unsigned NOT NULL DEFAULT 0,
`password` varchar(255) NOT NULL DEFAULT '',
`language` varchar(16) NOT NULL DEFAULT '',
`note` text,
PRIMARY KEY(`id`)
) DEFAULT CHARSET=utf8mb4;
@ -974,6 +980,7 @@ CREATE TABLE IF NOT EXISTS `term` (
INDEX `type_term` (`type`,`term`),
INDEX `uid_otype_type_term_global_created` (`uid`,`otype`,`type`,`term`,`global`,`created`),
INDEX `otype_type_term_tid` (`otype`,`type`,`term`,`tid`),
INDEX `uid_otype_type_url` (`uid`,`otype`,`type`,`url`),
INDEX `guid` (`guid`)
) DEFAULT CHARSET=utf8mb4;

View file

@ -8,7 +8,11 @@ Getting started
[Vagrant](https://www.vagrantup.com/) is a virtualization solution for developers.
No need to setup up a webserver, database etc. before actually starting.
Vagrant creates a virtual machine (an Ubuntu 14.04) for you that you can just run inside VirtualBox and start to work directly on Friendica.
Vagrant creates a virtual machine for you that you can just run inside VirtualBox and start to work directly on Friendica.
You can choose between two different Ubuntu Linux versions:
1. Ubuntu Trusty (14.04) with PHP 5.5.9 and MySQL 5.5.53
2. Ubuntu Xenial (16.04) with PHP 7.0 and MySQL 5.7.16
What you need to do:
@ -16,21 +20,27 @@ What you need to do:
Please use an up-to-date vagrant version from https://www.vagrantup.com/downloads.html.
2. Git clone your Friendica repository.
Inside, you'll find a "Vagrantfile" and some scripts in the utils folder.
3. Run "vagrant up" from inside the friendica clone.
3. Choose the Ubuntu version you'll need und run "vagrant up <ubuntu-version>" from inside the friendica clone:
$> vagrant up trusty
$> vagrant up xenial
Be patient: When it runs for the first time, it downloads an Ubuntu Server image.
4. Run "vagrant ssh" to log into the virtual machine to log in to the VM.
5. Open 192.168.22.10 in a browser.
4. Run "vagrant ssh <ubuntu-version>" to log into the virtual machine to log in to the VM:
$> vagrant ssh trusty
$> vagrant ssh xenial
5. Open you test installation in a browser.
If you selected an Ubuntu Trusty go to 192.168.22.10.
If you started a Xenial machine go to 192.168.22.11.
The mysql database is called "friendica", the mysql user and password both are "root".
6. Work on Friendica's code in your git clone on your machine (not in the VM).
Your local working directory is set up as a shared directory with the VM (/vagrant).
7. Check the changes in your browser in the VM.
Debug via the "vagrant ssh" login.
Debug via the "vagrant ssh <ubuntu-version>" login.
Find the Friendica log file /vagrant/logfile.out.
8. Commit and push your changes directly back to Github.
If you want to stop vagrant after finishing your work, run the following command
$> vagrant halt
$> vagrant halt <ubuntu-version>
in the development directory.
@ -44,10 +54,3 @@ You will then have the following accounts to login:
* friendica2 and friendica3 are conntected. friendica4 and friendica5 are connected.
For further documentation of vagrant, please see [the vagrant*docs*](https://docs.vagrantup.com/v2/).
**Important notice:**
If you already had an Ubuntu 12.04 Vagrant VM, please run
$> vagrant destroy
before starting the new 14.04 machine.

View file

@ -145,7 +145,6 @@ function terminate_friendship($user,$self,$contact) {
// This provides for the possibility that their database is temporarily messed
// up or some other transient event and that there's a possibility we could recover from it.
if(! function_exists('mark_for_death')) {
function mark_for_death($contact) {
if($contact['archive'])
@ -156,14 +155,24 @@ function mark_for_death($contact) {
dbesc(datetime_convert()),
intval($contact['id'])
);
if ($contact['url'] != '') {
q("UPDATE `contact` SET `term-date` = '%s'
WHERE `nurl` = '%s' AND `term-date` <= '1000-00-00'",
dbesc(datetime_convert()),
dbesc(normalise_link($contact['url']))
);
}
else {
} else {
/// @todo
/// We really should send a notification to the owner after 2-3 weeks
/// so they won't be surprised when the contact vanishes and can take
/// remedial action if this was a serious mistake or glitch
/// @todo
/// Check for contact vitality via probing
$expiry = $contact['term-date'] . ' + 32 days ';
if(datetime_convert() > datetime_convert('UTC','UTC',$expiry)) {
@ -171,26 +180,45 @@ function mark_for_death($contact) {
// archive them rather than delete
// though if the owner tries to unarchive them we'll start the whole process over again
q("update contact set `archive` = 1 where id = %d",
q("UPDATE `contact` SET `archive` = 1 WHERE `id` = %d",
intval($contact['id'])
);
q("UPDATE `item` SET `private` = 2 WHERE `contact-id` = %d AND `uid` = %d", intval($contact['id']), intval($contact['uid']));
//contact_remove($contact['id']);
if ($contact['url'] != '') {
q("UPDATE `contact` SET `archive` = 1 WHERE `nurl` = '%s'",
dbesc(normalise_link($contact['url']))
);
}
}
}
}}
}
if(! function_exists('unmark_for_death')) {
function unmark_for_death($contact) {
$r = q("SELECT `term-date` FROM `contact` WHERE `id` = %d AND `term-date` > '%s'",
intval($contact['id']),
dbesc('1000-00-00 00:00:00')
);
// We don't need to update, we never marked this contact as dead
if (!dbm::is_result($r)) {
return;
}
// It's a miracle. Our dead contact has inexplicably come back to life.
q("UPDATE `contact` SET `term-date` = '%s' WHERE `id` = %d",
dbesc('0000-00-00 00:00:00'),
intval($contact['id'])
);
}}
if ($contact['url'] != '') {
q("UPDATE `contact` SET `term-date` = '%s' WHERE `nurl` = '%s'",
dbesc('0000-00-00 00:00:00'),
dbesc(normalise_link($contact['url']))
);
}
}
/**
* @brief Get contact data for a given profile link

View file

@ -623,7 +623,7 @@
// count friends
$r = q("SELECT count(*) as `count` FROM `contact`
WHERE `uid` = %d AND `rel` IN ( %d, %d )
AND `self`=0 AND `blocked`=0 AND `pending`=0 AND `hidden`=0",
AND `self`=0 AND `blocked`=0 AND `hidden`=0",
intval($uinfo[0]['uid']),
intval(CONTACT_IS_SHARING),
intval(CONTACT_IS_FRIEND)
@ -632,7 +632,7 @@
$r = q("SELECT count(*) as `count` FROM `contact`
WHERE `uid` = %d AND `rel` IN ( %d, %d )
AND `self`=0 AND `blocked`=0 AND `pending`=0 AND `hidden`=0",
AND `self`=0 AND `blocked`=0 AND `hidden`=0",
intval($uinfo[0]['uid']),
intval(CONTACT_IS_FOLLOWER),
intval(CONTACT_IS_FRIEND)
@ -1399,7 +1399,7 @@
`contact`.`id` AS `cid`
FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
WHERE `item`.`uid` = %d AND `verb` = '%s'
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
$sql_extra
@ -1476,7 +1476,7 @@
`user`.`nickname`, `user`.`hidewall`
FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
STRAIGHT_JOIN `user` ON `user`.`uid` = `item`.`uid`
AND NOT `user`.`hidewall`
WHERE `verb` = '%s' AND `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
@ -1543,7 +1543,7 @@
`contact`.`id` AS `cid`
FROM `item`
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
WHERE `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
AND `item`.`uid` = %d AND `item`.`verb` = '%s'
$sql_extra",
@ -1619,7 +1619,7 @@
`contact`.`id` AS `cid`
FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
WHERE `item`.`parent` = %d AND `item`.`visible`
AND NOT `item`.`moderated` AND NOT `item`.`deleted`
AND `item`.`uid` = %d AND `item`.`verb` = '%s'
@ -1673,7 +1673,7 @@
`contact`.`id` AS `cid`
FROM `item`
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
WHERE `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
AND NOT `item`.`private` AND `item`.`allow_cid` = '' AND `item`.`allow`.`gid` = ''
AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
@ -1792,7 +1792,7 @@
`contact`.`id` AS `cid`
FROM `item` FORCE INDEX (`uid_id`)
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
WHERE `item`.`uid` = %d AND `verb` = '%s'
AND NOT (`item`.`author-link` IN ('https://%s', 'http://%s'))
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
@ -1866,7 +1866,7 @@
`contact`.`id` AS `cid`
FROM `item` FORCE INDEX (`uid_contactid_id`)
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
WHERE `item`.`uid` = %d AND `verb` = '%s'
AND `item`.`contact-id` = %d
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
@ -2002,7 +2002,7 @@
AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
AND `item`.`starred` = 1
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND NOT `contact`.`blocked`
$sql_extra
AND `item`.`id`>%d
ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
@ -2648,7 +2648,7 @@
if ($user_info['self'] == 0)
$sql_extra = " AND false ";
$r = q("SELECT `nurl` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 $sql_extra",
$r = q("SELECT `nurl` FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `blocked` $sql_extra",
intval(api_user())
);

View file

@ -84,9 +84,14 @@ class Cache {
$memcache = self::memcache();
if (is_object($memcache)) {
// We fetch with the hostname as key to avoid problems with other applications
$value = $memcache->get(get_app()->get_hostname().":".$key);
if (!is_bool($value)) {
return unserialize($value);
$cached = $memcache->get(get_app()->get_hostname().":".$key);
$value = @unserialize($cached);
// Only return a value if the serialized value is valid.
// We also check if the db entry is a serialized
// boolean 'false' value (which we want to return).
if ($cached === serialize(false) || $value !== false) {
return $value;
}
return null;
@ -100,7 +105,15 @@ class Cache {
);
if (dbm::is_result($r)) {
return unserialize($r[0]['v']);
$cached = $r[0]['v'];
$value = @unserialize($cached);
// Only return a value if the serialized value is valid.
// We also check if the db entry is a serialized
// boolean 'false' value (which we want to return).
if ($cached === serialize(false) || $value !== false) {
return $value;
}
}
return null;

View file

@ -439,7 +439,7 @@ These Fields are not added below (yet). They are here to for bug search.
function item_joins() {
return "STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND
NOT `contact`.`blocked` AND NOT `contact`.`pending`
NOT `contact`.`blocked`
LEFT JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id`
LEFT JOIN `contact` AS `owner` ON `owner`.`id`=`item`.`owner-id`";
}
@ -885,7 +885,7 @@ function best_link_url($item,&$sparkle,$ssl_state = false) {
$clean_url = normalise_link($item['author-link']);
if (local_user()) {
$r = q("SELECT `id` FROM `contact` WHERE `network` = '%s' AND `uid` = %d AND `nurl` = '%s' AND NOT `pending` LIMIT 1",
$r = q("SELECT `id` FROM `contact` WHERE `network` = '%s' AND `uid` = %d AND `nurl` = '%s' LIMIT 1",
dbesc(NETWORK_DFRN), intval(local_user()), dbesc(normalise_link($clean_url)));
if ($r) {
$best_url = 'redir/'.$r[0]['id'];

View file

@ -109,6 +109,17 @@ class dba {
return $return;
}
/**
* @brief Returns the selected database name
*
* @return string
*/
public function database_name() {
$r = $this->q("SELECT DATABASE() AS `db`");
return $r[0]['db'];
}
/**
* @brief Returns the number of rows
*

View file

@ -1280,6 +1280,7 @@ function db_definition($charset) {
"uid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
"password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"language" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
"note" => array("type" => "text"),
),
"indexes" => array(
"PRIMARY" => array("id"),

View file

@ -381,7 +381,14 @@ function delivery_run(&$argv, &$argc){
if ($deliver_status == (-1)) {
logger('notifier: delivery failed: queuing message');
add_to_queue($contact['id'],NETWORK_DFRN,$atom);
// The message could not be delivered. We mark the contact as "dead"
mark_for_death($contact);
} else {
// We successfully delivered a message, the contact is alive
unmark_for_death($contact);
}
break;
case NETWORK_OSTATUS:

View file

@ -134,7 +134,7 @@ class dfrn {
break; // NOTREACHED
}
$r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 AND `contact`.`uid` = %d $sql_extra LIMIT 1",
$r = q("SELECT * FROM `contact` WHERE NOT `blocked` AND `contact`.`uid` = %d $sql_extra LIMIT 1",
intval($owner_id)
);

View file

@ -999,17 +999,21 @@ class diaspora {
*/
private function author_contact_by_url($contact, $person, $uid) {
$r = q("SELECT `id`, `network` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d LIMIT 1",
$r = q("SELECT `id`, `network`, `url` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d LIMIT 1",
dbesc(normalise_link($person["url"])), intval($uid));
if ($r) {
$cid = $r[0]["id"];
$network = $r[0]["network"];
// We are receiving content from a user that is about to be terminated
// This means the user is vital, so we remove a possible termination date.
unmark_for_death($contact);
} else {
$cid = $contact["id"];
$network = NETWORK_DIASPORA;
}
return (array("cid" => $cid, "network" => $network));
return array("cid" => $cid, "network" => $network);
}
/**
@ -2633,7 +2637,13 @@ class diaspora {
} else {
// queue message for redelivery
add_to_queue($contact["id"], NETWORK_DIASPORA, $slap, $public_batch);
// The message could not be delivered. We mark the contact as "dead"
mark_for_death($contact);
}
} elseif (($return_code >= 200) AND ($return_code <= 299)) {
// We successfully delivered a message, the contact is alive
unmark_for_death($contact);
}
return(($return_code) ? $return_code : (-1));

View file

@ -371,7 +371,7 @@ function profile_sidebar($profile, $block = 0) {
if(count($r))
$updated = date("c", strtotime($r[0]['updated']));
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s', '')",
intval($profile['uid']),
dbesc(NETWORK_DFRN),

View file

@ -1079,10 +1079,12 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
return array();
}
$list = Cache::get("suggestion_query:".$uid.":".$start.":".$limit);
if (!is_null($list)) {
return $list;
}
// Uncommented because the result of the queries are to big to store it in the cache.
// We need to decide if we want to change the db column type or if we want to delete it.
// $list = Cache::get("suggestion_query:".$uid.":".$start.":".$limit);
// if (!is_null($list)) {
// return $list;
// }
$network = array(NETWORK_DFRN);
@ -1116,7 +1118,10 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
);
if (count($r) && count($r) >= ($limit -1)) {
Cache::set("suggestion_query:".$uid.":".$start.":".$limit, $r, CACHE_FIVE_MINUTES);
// Uncommented because the result of the queries are to big to store it in the cache.
// We need to decide if we want to change the db column type or if we want to delete it.
// Cache::set("suggestion_query:".$uid.":".$start.":".$limit, $r, CACHE_FIVE_MINUTES);
return $r;
}
@ -1147,7 +1152,9 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
while (sizeof($list) > ($limit))
array_pop($list);
Cache::set("suggestion_query:".$uid.":".$start.":".$limit, $list, CACHE_FIVE_MINUTES);
// Uncommented because the result of the queries are to big to store it in the cache.
// We need to decide if we want to change the db column type or if we want to delete it.
// Cache::set("suggestion_query:".$uid.":".$start.":".$limit, $list, CACHE_FIVE_MINUTES);
return $list;
}

View file

@ -874,8 +874,8 @@ function contact_block() {
if((! is_array($a->profile)) || ($a->profile['hide-friends']))
return $o;
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0
AND `hidden` = 0 AND `archive` = 0
WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s')",
intval($a->profile['uid']),
dbesc(NETWORK_DFRN),
@ -892,7 +892,7 @@ function contact_block() {
} else {
// Splitting the query in two parts makes it much faster
$r = q("SELECT `id` FROM `contact`
WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending`
WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s') ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),

View file

@ -428,6 +428,21 @@ function admin_page_queue(&$a) {
* @return string
*/
function admin_page_summary(&$a) {
global $db;
// are there MyISAM tables in the DB? If so, trigger a warning message
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1",
dbesc($db->database_name()));
$showwarning = false;
$warningtext = array();
if (dbm::is_result($r)) {
$showwarning = true;
$warningtext[] = sprintf(t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the <tt>convert_innodb.sql</tt> in the <tt>/util</tt> directory of your Friendica installation.<br />'), 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
}
// MySQL >= 5.7.4 doesn't support the IGNORE keyword in ALTER TABLE statements
if ((version_compare($db->server_info(), '5.7.4') >= 0) AND
!(strpos($db->server_info(), 'MariaDB') !== false)) {
$warningtext[] = t('You are using a MySQL version which does not support all features that Friendica uses. You should consider switching to MariaDB.');
}
$r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`");
$accounts = array(
array(t('Normal Account'), 0),
@ -478,7 +493,9 @@ function admin_page_summary(&$a) {
'$platform' => FRIENDICA_PLATFORM,
'$codename' => FRIENDICA_CODENAME,
'$build' => get_config('system','build'),
'$plugins' => array(t('Active plugins'), $a->plugins)
'$plugins' => array(t('Active plugins'), $a->plugins),
'$showwarning' => $showwarning,
'$warningtext' => $warningtext
));
}
@ -1388,6 +1405,7 @@ function admin_page_users(&$a){
'$h_deleted' => t('User waiting for permanent deletion'),
'$th_pending' => array(t('Request date'), t('Name'), t('Email')),
'$no_pending' => t('No registrations.'),
'$pendingnotetext' => t('Note from the user'),
'$approve' => t('Approve'),
'$deny' => t('Deny'),
'$delete' => t('Delete'),

View file

@ -744,6 +744,9 @@ function item_post(&$a) {
if($preview) {
require_once('include/conversation.php');
// We set the datarray ID to -1 because in preview mode the dataray
// doesn't have an ID.
$datarray["id"] = -1;
$o = conversation($a,array(array_merge($contact_record,$datarray)),'search', false, true);
logger('preview: ' . $o);
echo json_encode(array('preview' => $o));

View file

@ -395,10 +395,10 @@ function network_content(&$a, $update = 0) {
if($group) {
if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) {
notice( sprintf( tt('Warning: This group contains %s member from an insecure network.',
'Warning: This group contains %s members from an insecure network.',
$t), $t ) . EOL);
notice( t('Private messages to this group are at risk of public disclosure.') . EOL);
notice(sprintf(tt("Warning: This group contains %s member from a network that doesn't allow non public messages.",
"Warning: This group contains %s members from a network that doesn't allow non public messages.",
$t), $t).EOL);
notice(t("Messages in this group won't be send to these receivers.").EOL);
}
}
@ -453,6 +453,7 @@ function network_content(&$a, $update = 0) {
if ($nouveau OR strlen($file) OR $update) {
$sql_table = "`item`";
$sql_parent = "`parent`";
$sql_post_table = " INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent`";
}
$sql_nets = (($nets) ? sprintf(" and $sql_table.`network` = '%s' ", dbesc($nets)) : '');
@ -487,9 +488,9 @@ function network_content(&$a, $update = 0) {
$gcontact_str_self = $self[0]["gid"];
}
$sql_post_table = " INNER JOIN `item` AS `temp1` ON `temp1`.`id` = ".$sql_table.".".$sql_parent;
$sql_extra3 .= " AND ($sql_table.`contact-id` IN ($contact_str) ";
$sql_extra3 .= " OR ($sql_table.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '".protect_sprintf('%<'.intval($group).'>%')."' AND `temp1`.`private`))";
$sql_post_table .= " INNER JOIN `item` AS `temp1` ON `temp1`.`id` = ".$sql_table.".".$sql_parent;
$sql_extra3 .= " AND (`thread`.`contact-id` IN ($contact_str) ";
$sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '".protect_sprintf('%<'.intval($group).'>%')."' AND `temp1`.`private`))";
} else {
$sql_extra3 .= " AND false ";
info( t('Group is empty'));
@ -503,7 +504,7 @@ function network_content(&$a, $update = 0) {
elseif($cid) {
$r = qu("SELECT `id`,`name`,`network`,`writable`,`nurl`, `forum`, `prv`, `contact-type`, `addr`, `thumb`, `location` FROM `contact` WHERE `id` = %d
AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
AND NOT `blocked` LIMIT 1",
intval($cid)
);
if(count($r)) {
@ -569,7 +570,7 @@ function network_content(&$a, $update = 0) {
if($tag) {
$sql_extra = "";
$sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
$sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), intval(local_user()));
$sql_order = "`item`.`id`";
$order_mode = "id";
@ -583,7 +584,7 @@ function network_content(&$a, $update = 0) {
}
}
if(strlen($file)) {
$sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
$sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
dbesc(protect_sprintf($file)), intval(TERM_OBJ_POST), intval(TERM_FILE), intval(local_user()));
$sql_order = "`item`.`id`";
$order_mode = "id";
@ -602,7 +603,7 @@ function network_content(&$a, $update = 0) {
if(get_config('system', 'old_pager')) {
$r = qu("SELECT COUNT(*) AS `total`
FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = $sql_table.`contact-id`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
WHERE $sql_table.`uid` = %d AND $sql_table.`visible` AND NOT $sql_table.`deleted`
$sql_extra2 $sql_extra3
$sql_extra $sql_nets ",
@ -680,7 +681,7 @@ function network_content(&$a, $update = 0) {
$r = qu("SELECT `item`.`parent` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid`
FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted` $sql_extra4
AND NOT `item`.`moderated` AND `item`.`unseen`
$sql_extra3 $sql_extra $sql_nets
@ -690,7 +691,7 @@ function network_content(&$a, $update = 0) {
} else {
$r = qu("SELECT `thread`.`iid` AS `item_id`, `thread`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid`
FROM $sql_table $sql_post_table STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND NOT `contact`.`blocked`
WHERE `thread`.`uid` = %d AND `thread`.`visible` AND NOT `thread`.`deleted`
AND NOT `thread`.`moderated`
$sql_extra2 $sql_extra3 $sql_extra $sql_nets

View file

@ -131,7 +131,7 @@ function ping_init(App $a)
if ($item['wall']) {
$home_count++;
} else {
$network++;
$network_count++;
}
}
}
@ -174,7 +174,7 @@ function ping_init(App $a)
intval(local_user())
);
$intro = count($intros1) + count($intros2);
$intro_count = count($intros1) + count($intros2);
$intros = $intros1+$intros2;
$myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
@ -190,10 +190,8 @@ function ping_init(App $a)
FROM `contact` RIGHT JOIN `register` ON `register`.`uid` = `contact`.`uid`
WHERE `contact`.`self` = 1");
if ($regs) {
$register = $regs[0]['total'];
$register_count = $regs[0]['total'];
}
} else {
$register = 0;
}
$ev = q("SELECT count(`event`.`id`) AS total, type, start, adjust FROM `event`
@ -231,9 +229,9 @@ function ping_init(App $a)
$data['intro'] = $intro_count;
$data['mail'] = $mail_count;
$data['net'] = $network;
$data['home'] = $home;
$data['register'] = $register;
$data['net'] = $network_count;
$data['home'] = $home_count;
$data['register'] = $register_count;
$data['all-events'] = $all_events;
$data['all-events-today'] = $all_events_today;
@ -242,10 +240,10 @@ function ping_init(App $a)
$data['birthdays'] = $birthdays;
$data['birthdays-today'] = $birthdays_today;
if (dbm::is_result($notifs) && !$sysnotify) {
if (dbm::is_result($notifs)) {
foreach ($notifs as $notif) {
if ($notif['seen'] == 0) {
$sysnotify ++;
$sysnotify_count ++;
}
}
}
@ -356,7 +354,7 @@ function ping_init(App $a)
if ($format == 'json') {
$data['groups'] = $groups_unseen;
$data['forums'] = $forums_unseen;
$data['notify'] = $sysnotify + $intro + $mail_count + $register;
$data['notify'] = $sysnotify_count + $intro_count + $mail_count + $register_count;
$data['notifications'] = $notifications;
$data['sysmsgs'] = array(
'notice' => $sysmsgs,
@ -375,7 +373,7 @@ function ping_init(App $a)
}
} else {
// Legacy slower XML format output
$data = ping_format_xml_data($data, $sysnotify, $notifications, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen);
$data = ping_format_xml_data($data, $sysnotify_count, $notifications, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen);
header("Content-type: text/xml");
echo xml::from_array(array("result" => $data), $xml);
@ -468,7 +466,7 @@ function ping_get_notifications($uid)
* @deprecated
*
* @param array $data The initial ping data array
* @param int $sysnotify Number of unseen system notifications
* @param int $sysnotify_count Number of unseen system notifications
* @param array $notifs Complete list of notification
* @param array $sysmsgs List of system notice messages
* @param array $sysmsgs_info List of system info messages

View file

@ -233,66 +233,87 @@ function proxy_init() {
killme();
}
function proxy_url($url, $writemode = false, $size = "") {
global $_SERVER;
/**
* @brief Transform a remote URL into a local one
*
* This function only performs the URL replacement on http URL and if the
* provided URL isn't local, "the isn't deactivated" (sic) and if the config
* system.proxy_disabled is set to false.
*
* @param string $url The URL to proxyfy
* @param bool $writemode Returns a local path the remote URL should be saved to
* @param string $size One of the PROXY_SIZE_* constants
*
* @return string The proxyfied URL or relative path
*/
function proxy_url($url, $writemode = false, $size = '') {
$a = get_app();
if (substr($url, 0, strlen('http')) !== 'http') {
return($url);
return $url;
}
// Only continue if it isn't a local image and the isn't deactivated
if (proxy_is_local_image($url)) {
$url = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $url);
return($url);
$url = str_replace(normalise_link($a->get_baseurl()) . '/', $a->get_baseurl() . '/', $url);
return $url;
}
if (get_config("system", "proxy_disabled"))
return($url);
if (get_config('system', 'proxy_disabled')) {
return $url;
}
// Image URL may have encoded ampersands for display which aren't desirable for proxy
$url = html_entity_decode($url, ENT_NOQUOTES, 'utf-8');
// Creating a sub directory to reduce the amount of files in the cache directory
$basepath = $a->get_basepath()."/proxy";
$basepath = $a->get_basepath() . '/proxy';
$path = substr(hash("md5", $url), 0, 2);
$shortpath = hash('md5', $url);
$longpath = substr($shortpath, 0, 2);
if (is_dir($basepath) and $writemode)
if (!is_dir($basepath."/".$path)) {
mkdir($basepath."/".$path);
chmod($basepath."/".$path, 0777);
if (is_dir($basepath) and $writemode) {
if (!is_dir($basepath . '/' . $longpath)) {
mkdir($basepath . '/' . $longpath);
chmod($basepath . '/' . $longpath, 0777);
}
}
$path .= "/".strtr(base64_encode($url), '+/', '-_');
$longpath .= '/' . strtr(base64_encode($url), '+/', '-_');
// Checking for valid extensions. Only add them if they are safe
$pos = strrpos($url, ".");
$pos = strrpos($url, '.');
if ($pos) {
$extension = strtolower(substr($url, $pos + 1));
$pos = strpos($extension, '?');
if ($pos) {
$extension = strtolower(substr($url, $pos+1));
$pos = strpos($extension, "?");
if ($pos)
$extension = substr($extension, 0, $pos);
}
}
$extensions = array("jpg", "jpeg", "gif", "png");
$extensions = array('jpg', 'jpeg', 'gif', 'png');
if (in_array($extension, $extensions)) {
$shortpath .= '.' . $extension;
$longpath .= '.' . $extension;
}
if (in_array($extension, $extensions))
$path .= ".".$extension;
$proxypath = $a->get_baseurl() . '/proxy/' . $longpath;
$proxypath = $a->get_baseurl()."/proxy/".$path;
if ($size != "")
$size = ":".$size;
if ($size != '') {
$size = ':' . $size;
}
// Too long files aren't supported by Apache
// Writemode in combination with long files shouldn't be possible
if ((strlen($proxypath) > 250) AND $writemode)
return (hash("md5", $url));
elseif (strlen($proxypath) > 250)
return ($a->get_baseurl()."/proxy/".hash("md5", $url)."?url=".urlencode($url));
elseif ($writemode)
return ($path);
else
return ($proxypath.$size);
if ((strlen($proxypath) > 250) AND $writemode) {
return $shortpath;
} elseif (strlen($proxypath) > 250) {
return $a->get_baseurl() . '/proxy/' . $shortpath . '?url=' . urlencode($url);
} elseif ($writemode) {
return $longpath;
} else {
return $proxypath . $size;
}
}
/**

View file

@ -113,12 +113,13 @@ function register_post(&$a) {
}
$hash = random_string();
$r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language` ) VALUES ( '%s', '%s', %d, '%s', '%s' ) ",
$r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language`, `note` ) VALUES ( '%s', '%s', %d, '%s', '%s', '%s' ) ",
dbesc($hash),
dbesc(datetime_convert()),
intval($user['uid']),
dbesc($result['password']),
dbesc($lang)
dbesc($lang),
dbesc($_POST['permonlybox'])
);
// invite system
@ -262,6 +263,8 @@ function register_content(&$a) {
$o = replace_macros($o, array(
'$oidhtml' => $oidhtml,
'$invitations' => get_config('system','invitation_only'),
'$permonly' => $a->config['register_policy'] == REGISTER_APPROVE,
'$permonlybox' => array('permonlybox', t('Note for the admin'), '', t('Leave a message for the admin, why you want to join this node')),
'$invite_desc' => t('Membership on this site is by invitation only.'),
'$invite_label' => t('Your invitation ID: '),
'$invite_id' => $invite_id,

View file

@ -301,6 +301,7 @@ function settings_post(&$a) {
$infinite_scroll = x($_POST, 'infinite_scroll') ? intval($_POST['infinite_scroll']) : 0;
$no_auto_update = x($_POST, 'no_auto_update') ? intval($_POST['no_auto_update']) : 0;
$bandwidth_saver = x($_POST, 'bandwidth_saver') ? intval($_POST['bandwidth_saver']) : 0;
$nowarn_insecure = x($_POST, 'nowarn_insecure') ? intval($_POST['nowarn_insecure']) : 0;
$browser_update = x($_POST, 'browser_update') ? intval($_POST['browser_update']) : 0;
if ($browser_update != -1) {
$browser_update = $browser_update * 1000;
@ -321,6 +322,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'system','mobile_theme',$mobile_theme);
}
set_pconfig(local_user(), 'system', 'nowarn_insecure' , $nowarn_insecure);
set_pconfig(local_user(), 'system', 'update_interval' , $browser_update);
set_pconfig(local_user(), 'system', 'itemspage_network' , $itemspage_network);
set_pconfig(local_user(), 'system', 'itemspage_mobile_network', $itemspage_mobile_network);
@ -951,6 +953,8 @@ function settings_content(&$a) {
$theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
$mobile_theme_selected = (!x($_SESSION,'mobile-theme')? $default_mobile_theme : $_SESSION['mobile-theme']);
$nowarn_insecure = intval(get_pconfig(local_user(), 'system', 'nowarn_insecure'));
$browser_update = intval(get_pconfig(local_user(), 'system','update_interval'));
if (intval($browser_update) != -1)
$browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
@ -995,6 +999,7 @@ function settings_content(&$a) {
'$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, true),
'$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false),
'$nowarn_insecure' => array('nowarn_insecure', t('Suppress warning of insecure networks'), $nowarn_insecure, t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")),
'$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds. Enter -1 to disable it.')),
'$itemspage_network' => array('itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')),
'$itemspage_mobile_network' => array('itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')),

View file

@ -47,7 +47,7 @@ function viewcontacts_content(&$a) {
}
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
WHERE `uid` = %d AND NOT `blocked` AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s')",
intval($a->profile['uid']),
dbesc(NETWORK_DFRN),
@ -58,7 +58,7 @@ function viewcontacts_content(&$a) {
$a->set_pager_total($r[0]['total']);
$r = q("SELECT * FROM `contact`
WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
WHERE `uid` = %d AND NOT `blocked` AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s')
ORDER BY `name` ASC LIMIT %d, %d",
intval($a->profile['uid']),

View file

@ -1,6 +1,6 @@
<?php
define('UPDATE_VERSION' , 1208);
define('UPDATE_VERSION' , 1209);
/**
*

4
util/convert_innodb.sql Normal file
View file

@ -0,0 +1,4 @@
SELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' engine=InnoDB;')
FROM information_schema.tables
WHERE engine = 'MyISAM';

File diff suppressed because it is too large Load diff

View file

@ -32,16 +32,30 @@ sudo apt-get install -y apache2
sudo a2enmod rewrite actions ssl
sudo cp /vagrant/util/vagrant_vhost.sh /usr/local/bin/vhost
sudo chmod guo+x /usr/local/bin/vhost
sudo vhost -s 192.168.22.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.dev
sudo a2dissite 000-default
sudo service apache2 restart
if [ $( lsb_release -c | cut -f 2 ) == "trusty" ]; then
sudo vhost -s 192.168.22.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica-trusty.dev
sudo a2dissite 000-default
sudo service apache2 restart
elif [ $( lsb_release -c | cut -f 2 ) == "xenial" ]; then
sudo vhost -s 192.168.22.11.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica-xenial.dev
sudo a2dissite 000-default
sudo systemctl restart apache2
fi
#Install php
echo ">>> Installing PHP5"
sudo apt-get install -y php5 libapache2-mod-php5 php5-cli php5-mysql php5-curl php5-gd
sudo apt-get install -y imagemagick
sudo apt-get install -y php5-imagick
sudo service apache2 restart
if [ $( lsb_release -c | cut -f 2 ) == "trusty" ]; then
echo ">>> Installing PHP5"
sudo apt-get install -y php5 libapache2-mod-php5 php5-cli php5-mysql php5-curl php5-gd
sudo apt-get install -y imagemagick
sudo apt-get install -y php5-imagick
sudo service apache2 restart
elif [ $( lsb_release -c | cut -f 2 ) == "xenial" ]; then
echo ">>> Installing PHP7"
sudo apt-get install -y php libapache2-mod-php php-cli php-mysql php-curl php-gd
sudo apt-get install -y imagemagick
sudo apt-get install -y php-imagick
sudo systemctl restart apache2
fi
#Install mysql
@ -59,12 +73,21 @@ Q1="GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;"
Q2="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}"
$MYSQL -uroot -proot -e "$SQL"
service mysql restart
if [ $( lsb_release -c | cut -f 2 ) == "trusty" ]; then
service mysql restart
elif [ $( lsb_release -c | cut -f 2 ) == "xenial" ]; then
systemctl restart mysql
fi
#configure rudimentary mail server (local delivery only)
#add Friendica accounts for local user accounts, use email address like vagrant@friendica.dev, read the email with 'mail'.
debconf-set-selections <<< "postfix postfix/mailname string friendica.dev"
if [ $( lsb_release -c | cut -f 2 ) == "trusty" ]; then
debconf-set-selections <<< "postfix postfix/mailname string friendica-trusty.dev"
elif [ $( lsb_release -c | cut -f 2 ) == "xenial" ]; then
debconf-set-selections <<< "postfix postfix/mailname string friendica-xenial.dev"
fi
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Local Only'"
sudo apt-get install -y postfix mailutils libmailutils-dev
sudo echo -e "friendica1: vagrant\nfriendica2: vagrant\nfriendica3: vagrant\nfriendica4: vagrant\nfriendica5: vagrant" >> /etc/aliases && sudo newaliases

View file

@ -464,3 +464,20 @@ td.federation-data {
#settings-form .pageflags {
margin: 0 0 20px 30px;
}
/* admin pending user notes */
td.pendingnote {
padding-left: 20px;
padding-right: 20px;
}
td.pendingnote > p > span {
font-weight: bold;
}
/* warning message */
.warning-message {
padding: 10px;
margin: 5px;
border-left: 5px solid #f00;
font-weight: bold;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,13 @@
<div id='adminpage'>
<h1>{{$title}} - {{$page}}</h1>
{{if $showwarning}}
<div id="admin-warning-message-wrapper">
{{foreach $warningtext as $wt}}
<p class="warning-message">{{$wt}}</p>
{{/foreach}}
</div>
{{/if}}
<dl>
<dt>{{$queues.label}}</dt>

View file

@ -39,6 +39,9 @@
<a href="{{$baseurl}}/regmod/deny/{{$u.hash}}" title='{{$deny}}'><span class='icon dislike'></span></a>
</td>
</tr>
<tr>
<td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td>
</tr>
{{/foreach}}
</tbody>
</table>

View file

@ -57,6 +57,10 @@
</div>
<div id="register-nickname-end" ></div>
{{if $permonly}}
{{include file="field_textarea.tpl" field=$permonlybox}}
{{/if}}
{{$publish}}
<div id="register-submit-wrapper">

View file

@ -9,6 +9,7 @@
{{include file="field_themeselect.tpl" field=$mobile_theme}}
{{include file="field_input.tpl" field=$itemspage_mobile_network}}
{{include file="field_input.tpl" field=$ajaxint}}
{{include file="field_checkbox.tpl" field=$nowarn_insecure}}
{{include file="field_checkbox.tpl" field=$no_auto_update}}
{{include file="field_checkbox.tpl" field=$nosmile}}
{{include file="field_checkbox.tpl" field=$noinfo}}

View file

@ -88,7 +88,7 @@ blockquote {
display: none !important;
}
code {
white-space: pre;
white-space: pre-wrap;
}
/*
@ -2407,3 +2407,11 @@ body .tread-wrapper .hovercard a:hover {
body .tread-wrapper .hovercard:hover .hover-card-content a {
color: $link_color !important;
}
/*
* some temporary workarounds until this will solved
* elsewhere (e.g. new templates)
*/
section .profile-match-wrapper {
float: left;
}

View file

@ -66,6 +66,7 @@
{{include file="field_input.tpl" field=$itemspage_network}}
{{include file="field_input.tpl" field=$itemspage_mobile_network}}
{{include file="field_input.tpl" field=$ajaxint}}
{{include file="field_checkbox.tpl" field=$nowarn_insecure}}
{{include file="field_checkbox.tpl" field=$no_auto_update}}
{{include file="field_checkbox.tpl" field=$nosmile}}
{{include file="field_checkbox.tpl" field=$noinfo}}