aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acl_selectors.php2
-rw-r--r--include/dba.php19
-rw-r--r--include/items.php2
-rw-r--r--include/poller.php5
4 files changed, 26 insertions, 2 deletions
diff --git a/include/acl_selectors.php b/include/acl_selectors.php
index 9467531d9..fa700818f 100644
--- a/include/acl_selectors.php
+++ b/include/acl_selectors.php
@@ -10,7 +10,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) {
$o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n";
$r = q("SELECT * FROM `group` WHERE `deleted` = 0 AND `uid` = %d ORDER BY `name` ASC",
- $_SESSION['uid']
+ intval(local_user())
);
diff --git a/include/dba.php b/include/dba.php
index d75ed560a..e2f369f19 100644
--- a/include/dba.php
+++ b/include/dba.php
@@ -19,6 +19,23 @@ class dba {
public $connected = false;
function __construct($server,$user,$pass,$db,$install = false) {
+
+ $server = trim($server);
+ $user = trim($user);
+ $pass = trim($pass);
+ $db = trim($db);
+
+ if($install) {
+ if(strlen($server) && ($server !== 'localhost') && ($server !== '127.0.0.1')) {
+ if(! dns_get_record($server, DNS_A + DNS_CNAME + DNS_PTR)) {
+ notice( sprintf( t('Cannot locate DNS info for database server \'%s\'',$server)));
+ $this->connected = false;
+ $this->db = null;
+ return;
+ }
+ }
+ }
+
$this->db = @new mysqli($server,$user,$pass,$db);
if(! mysqli_connect_errno()) {
$this->connected = true;
@@ -61,7 +78,7 @@ class dba {
}
else {
- /*
+ /**
* If dbfail.out exists, we will write any failed calls directly to it,
* regardless of any logging that may or may nor be in effect.
* These usually indicate SQL syntax errors that need to be resolved.
diff --git a/include/items.php b/include/items.php
index f38c0938f..e930ab5d2 100644
--- a/include/items.php
+++ b/include/items.php
@@ -609,6 +609,7 @@ function item_store($arr,$force_parent = false) {
else {
// find the parent and snarf the item id and ACL's
+ // and anything else we need to inherit
$r = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($arr['parent-uri']),
@@ -632,6 +633,7 @@ function item_store($arr,$force_parent = false) {
$allow_gid = $r[0]['allow_gid'];
$deny_cid = $r[0]['deny_cid'];
$deny_gid = $r[0]['deny_gid'];
+ $arr['wall'] = $r[0]['wall'];
}
else {
diff --git a/include/poller.php b/include/poller.php
index fd02e0198..a093190a6 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -47,6 +47,11 @@ function poller_run($argv, $argc){
$sql_extra = (($manual_id) ? " AND `id` = $manual_id " : "");
+ $d = datetime_convert();
+ call_hooks('cron', $d);
+
+ reload_plugins();
+
$contacts = q("SELECT `id` FROM `contact`
WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != ''
$sql_extra