Move Contact to src
- Add relevant use statements - Change method calls - Remove mentions to include/Contact.php
This commit is contained in:
parent
2df2942fd1
commit
ec0c2e837d
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
use Friendica\Model\User;
|
||||||
|
|
||||||
|
|
||||||
function public_server_install() {
|
function public_server_install() {
|
||||||
|
@ -75,10 +76,9 @@ function public_server_cron($a,$b) {
|
||||||
|
|
||||||
$r = q("select * from user where account_expired = 1 and account_expires_on < UTC_TIMESTAMP() - INTERVAL 5 DAY and account_expires_on > '0000-00-00 00:00:00'");
|
$r = q("select * from user where account_expired = 1 and account_expires_on < UTC_TIMESTAMP() - INTERVAL 5 DAY and account_expires_on > '0000-00-00 00:00:00'");
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
require_once('include/Contact.php');
|
foreach($r as $rr) {
|
||||||
foreach($r as $rr)
|
User::remove($rr['uid']);
|
||||||
user_remove($rr['uid']);
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
$nologin = Config::get('public_server','nologin');
|
$nologin = Config::get('public_server','nologin');
|
||||||
if($nologin) {
|
if($nologin) {
|
||||||
|
@ -123,7 +123,7 @@ function public_server_cron($a,$b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function public_server_enotify(&$a, &$b) {
|
function public_server_enotify(&$a, &$b) {
|
||||||
if (x($b, 'params') && $b['params']['type'] == NOTIFY_SYSTEM
|
if (x($b, 'params') && $b['params']['type'] == NOTIFY_SYSTEM
|
||||||
&& x($b['params'], 'system_type') && $b['params']['system_type'] === 'public_server_expire') {
|
&& x($b['params'], 'system_type') && $b['params']['system_type'] === 'public_server_expire') {
|
||||||
$b['itemlink'] = $a->get_baseurl();
|
$b['itemlink'] = $a->get_baseurl();
|
||||||
$b['epreamble'] = $b['preamble'] = sprintf( t('Your account on %s will expire in a few days.'), Config::get('system','sitename'));
|
$b['epreamble'] = $b['preamble'] = sprintf( t('Your account on %s will expire in a few days.'), Config::get('system','sitename'));
|
||||||
|
|
|
@ -10,6 +10,7 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Model\GlobalContact;
|
use Friendica\Model\GlobalContact;
|
||||||
|
use Friendica\Object\Contact;
|
||||||
|
|
||||||
require 'addon/pumpio/oauth/http.php';
|
require 'addon/pumpio/oauth/http.php';
|
||||||
require 'addon/pumpio/oauth/oauth_client.php';
|
require 'addon/pumpio/oauth/oauth_client.php';
|
||||||
|
@ -972,7 +973,7 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) {
|
||||||
"photo" => $contact->image->url, "name" => $contact->displayName, "hide" => true,
|
"photo" => $contact->image->url, "name" => $contact->displayName, "hide" => true,
|
||||||
"nick" => $contact->preferredUsername, "location" => $contact->location->displayName,
|
"nick" => $contact->preferredUsername, "location" => $contact->location->displayName,
|
||||||
"about" => $contact->summary, "addr" => str_replace("acct:", "", $contact->id)));
|
"about" => $contact->summary, "addr" => str_replace("acct:", "", $contact->id)));
|
||||||
$cid = get_contact($contact->url, $uid);
|
$cid = Contact::getIdForURL($contact->url, $uid);
|
||||||
|
|
||||||
if ($no_insert)
|
if ($no_insert)
|
||||||
return($cid);
|
return($cid);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
use Friendica\Model\User;
|
||||||
|
|
||||||
|
|
||||||
function testdrive_install() {
|
function testdrive_install() {
|
||||||
|
@ -79,12 +80,10 @@ function testdrive_cron($a,$b) {
|
||||||
|
|
||||||
$r = q("select * from user where account_expired = 1 and account_expires_on < UTC_TIMESTAMP() - INTERVAL 5 DAY ");
|
$r = q("select * from user where account_expired = 1 and account_expires_on < UTC_TIMESTAMP() - INTERVAL 5 DAY ");
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
require_once('include/Contact.php');
|
foreach($r as $rr) {
|
||||||
foreach($r as $rr)
|
User::remove($rr['uid']);
|
||||||
user_remove($rr['uid']);
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testdrive_enotify(&$a, &$b) {
|
function testdrive_enotify(&$a, &$b) {
|
||||||
|
|
Loading…
Reference in a new issue