Cleanups:
- don't commit files that are being ignored, better provide a "template" file that needs copying to the right file and ignore the file that will have local changes like config files will always have. - fixed CHMOD, no need for executable flag here as the server won't execute these files, but only load (read) them - fixed E_NOTICE in boot.php when entrance/index page (no parameter) is being called Signed-off-by: Roland Haeder <roland@mxchange.org>
|
@ -75,4 +75,4 @@ $a->config['maintenance'] = array(
|
||||||
//At which health value should we start removing profiles?
|
//At which health value should we start removing profiles?
|
||||||
'remove_profile_health_threshold' => -60
|
'remove_profile_health_threshold' => -60
|
||||||
|
|
||||||
);
|
);
|
|
@ -53,7 +53,7 @@ class App {
|
||||||
public $argc;
|
public $argc;
|
||||||
public $module;
|
public $module;
|
||||||
public $pager;
|
public $pager;
|
||||||
public $strings;
|
public $strings;
|
||||||
public $path;
|
public $path;
|
||||||
|
|
||||||
private $scheme;
|
private $scheme;
|
||||||
|
@ -80,7 +80,7 @@ class App {
|
||||||
|
|
||||||
$this->query_string = $_SERVER['QUERY_STRING'];
|
$this->query_string = $_SERVER['QUERY_STRING'];
|
||||||
|
|
||||||
$this->cmd = trim($_GET['q'],'/');
|
$this->cmd = (isset($_GET['q']) ? trim($_GET['q'],'/') : '');
|
||||||
|
|
||||||
|
|
||||||
$this->argv = explode('/',$this->cmd);
|
$this->argv = explode('/',$this->cmd);
|
||||||
|
|
Before Width: | Height: | Size: 83 B After Width: | Height: | Size: 83 B |
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 451 B After Width: | Height: | Size: 451 B |
Before Width: | Height: | Size: 1003 B After Width: | Height: | Size: 1003 B |
Before Width: | Height: | Size: 1015 B After Width: | Height: | Size: 1015 B |
Before Width: | Height: | Size: 346 B After Width: | Height: | Size: 346 B |
Before Width: | Height: | Size: 490 B After Width: | Height: | Size: 490 B |
Before Width: | Height: | Size: 109 B After Width: | Height: | Size: 109 B |
Before Width: | Height: | Size: 133 B After Width: | Height: | Size: 133 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 659 B After Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 699 B After Width: | Height: | Size: 699 B |
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 1004 B After Width: | Height: | Size: 1004 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 145 B |
Before Width: | Height: | Size: 932 B After Width: | Height: | Size: 932 B |
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 236 B |
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 999 B After Width: | Height: | Size: 999 B |
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 826 B |
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 974 B |
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 938 B After Width: | Height: | Size: 938 B |
|
@ -1,166 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
require_once("boot.php");
|
|
||||||
|
|
||||||
$a = new App;
|
|
||||||
|
|
||||||
@include(".htconfig.php");
|
|
||||||
require_once("dba.php");
|
|
||||||
$db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
|
|
||||||
unset($db_host, $db_user, $db_pass, $db_data);
|
|
||||||
|
|
||||||
ruire_once("esession.php");
|
|
||||||
require_once("datetime.php");
|
|
||||||
|
|
||||||
$a->set_baseurl(get_config('system','url'));
|
|
||||||
|
|
||||||
$u = q("SELECT * FROM `user` WHERE 1 LIMIT 1");
|
|
||||||
if(! count($u))
|
|
||||||
killme();
|
|
||||||
|
|
||||||
$uid = $u[0]['uid'];
|
|
||||||
$nickname = $u[0]['nickname'];
|
|
||||||
|
|
||||||
$intros = q("SELECT `intro`.*, `intro`.`id` AS `intro_id`, `contact`.*
|
|
||||||
FROM `intro` LEFT JOIN `contact` ON `contact`.`id` = `intro`.`contact-id`
|
|
||||||
WHERE `intro`.`blocked` = 0 AND `intro`.`ignore` = 0");
|
|
||||||
|
|
||||||
if(! count($intros))
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
foreach($intros as $intro) {
|
|
||||||
|
|
||||||
$intro_id = intval($intro['intro_id']);
|
|
||||||
|
|
||||||
$dfrn_id = $intro['issued-id'];
|
|
||||||
$contact_id = $intro['contact-id'];
|
|
||||||
$relation = $intro['rel'];
|
|
||||||
$site_pubkey = $intro['site-pubkey'];
|
|
||||||
$dfrn_confirm = $intro['confirm'];
|
|
||||||
$aes_allow = $intro['aes_allow'];
|
|
||||||
|
|
||||||
$res=openssl_pkey_new(array(
|
|
||||||
'digest_alg' => 'whirlpool',
|
|
||||||
'private_key_bits' => 4096,
|
|
||||||
'encrypt_key' => false ));
|
|
||||||
|
|
||||||
$private_key = '';
|
|
||||||
|
|
||||||
openssl_pkey_export($res, $private_key);
|
|
||||||
|
|
||||||
$pubkey = openssl_pkey_get_details($res);
|
|
||||||
$public_key = $pubkey["key"];
|
|
||||||
|
|
||||||
$r = q("UPDATE `contact` SET `issued-pubkey` = '%s', `prvkey` = '%s' WHERE `id` = %d LIMIT 1",
|
|
||||||
dbesc($public_key),
|
|
||||||
dbesc($private_key),
|
|
||||||
intval($contact_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
$params = array();
|
|
||||||
|
|
||||||
$src_aes_key = random_string();
|
|
||||||
$result = "";
|
|
||||||
|
|
||||||
openssl_private_encrypt($dfrn_id,$result,$u[0]['prvkey']);
|
|
||||||
|
|
||||||
$params['dfrn_id'] = $result;
|
|
||||||
$params['public_key'] = $public_key;
|
|
||||||
|
|
||||||
$my_url = $a->get_baseurl() . '/profile/' . $nickname ;
|
|
||||||
|
|
||||||
openssl_public_encrypt($my_url, $params['source_url'], $site_pubkey);
|
|
||||||
|
|
||||||
if($aes_allow && function_exists('openssl_encrypt')) {
|
|
||||||
openssl_public_encrypt($src_aes_key, $params['aes_key'], $site_pubkey);
|
|
||||||
$params['public_key'] = openssl_encrypt($public_key,'AES-256-CBC',$src_aes_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = post_url($dfrn_confirm,$params);
|
|
||||||
|
|
||||||
$xml = simplexml_load_string($res);
|
|
||||||
$status = (int) $xml->status;
|
|
||||||
switch($status) {
|
|
||||||
case 0:
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
// birthday paradox - generate new dfrn-id and fall through.
|
|
||||||
|
|
||||||
$new_dfrn_id = random_string();
|
|
||||||
$r = q("UPDATE contact SET `issued-id` = '%s' WHERE `id` = %d LIMIT 1",
|
|
||||||
dbesc($new_dfrn_id),
|
|
||||||
intval($contact_id)
|
|
||||||
);
|
|
||||||
case 2:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(($status == 0 || $status == 3) && ($intro_id)) {
|
|
||||||
|
|
||||||
// delete the notification
|
|
||||||
|
|
||||||
$r = q("DELETE FROM `intro` WHERE `id` = %d LIMIT 1",
|
|
||||||
intval($intro_id)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if($status != 0)
|
|
||||||
killme();
|
|
||||||
|
|
||||||
require_once("Photo.php");
|
|
||||||
|
|
||||||
$photo_failure = false;
|
|
||||||
|
|
||||||
|
|
||||||
$filename = basename($intro['photo']);
|
|
||||||
$img_str = fetch_url($intro['photo'],true);
|
|
||||||
$img = new Photo($img_str);
|
|
||||||
if($img) {
|
|
||||||
|
|
||||||
$img->scaleImageSquare(175);
|
|
||||||
$hash = hash('md5',uniqid(mt_rand(),true));
|
|
||||||
|
|
||||||
$r = $img->store($contact_id, $hash, $filename, t('Contact Photos'), 4 );
|
|
||||||
|
|
||||||
if($r === false)
|
|
||||||
$photo_failure = true;
|
|
||||||
$img->scaleImage(80);
|
|
||||||
|
|
||||||
$r = $img->store($contact_id, $hash, $filename, t('Contact Photos'), 5 );
|
|
||||||
|
|
||||||
if($r === false)
|
|
||||||
$photo_failure = true;
|
|
||||||
|
|
||||||
$photo = $a->get_baseurl() . '/photo/' . $hash . '-4.jpg';
|
|
||||||
$thumb = $a->get_baseurl() . '/photo/' . $hash . '-5.jpg';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$photo_failure = true;
|
|
||||||
|
|
||||||
if($photo_failure) {
|
|
||||||
$photo = $a->get_baseurl() . '/images/default-profile.jpg';
|
|
||||||
$thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg';
|
|
||||||
}
|
|
||||||
|
|
||||||
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `rel` = %d,
|
|
||||||
`name-date` = '%s', `uri-date` = '%s', `avatar-date` = '%s',
|
|
||||||
`readonly` = %d, `profile-id` = %d, `blocked` = 0, `pending` = 0,
|
|
||||||
`network` = 'dfrn' WHERE `id` = %d LIMIT 1",
|
|
||||||
dbesc($photo),
|
|
||||||
dbesc($thumb),
|
|
||||||
intval(($relation == DIRECTION_OUT) ? DIRECTION_BOTH : DIRECTION_IN),
|
|
||||||
dbesc(datetime_convert()),
|
|
||||||
dbesc(datetime_convert()),
|
|
||||||
dbesc(datetime_convert()),
|
|
||||||
intval((x($a->config,'rockstar-readonly')) ? $a->config['rockstar-readonly'] : 0),
|
|
||||||
intval((x($a->config,'rockstar-profile')) ? $a->config['rockstar-profile'] : 0),
|
|
||||||
intval($contact_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
killme();
|
|
||||||
|
|