Redesign prototype merge #18
0
.htaccess
Executable file → Normal file
|
@ -75,4 +75,4 @@ $a->config['maintenance'] = array(
|
|||
//At which health value should we start removing profiles?
|
||||
'remove_profile_health_threshold' => -60
|
||||
|
||||
);
|
||||
);
|
4
boot.php
Executable file → Normal file
|
@ -53,7 +53,7 @@ class App {
|
|||
public $argc;
|
||||
public $module;
|
||||
public $pager;
|
||||
public $strings;
|
||||
public $strings;
|
||||
public $path;
|
||||
|
||||
private $scheme;
|
||||
|
@ -80,7 +80,7 @@ class App {
|
|||
|
||||
$this->query_string = $_SERVER['QUERY_STRING'];
|
||||
|
||||
$this->cmd = trim($_GET['q'],'/');
|
||||
$this->cmd = (isset($_GET['q']) ? trim($_GET['q'],'/') : '');
|
||||
|
||||
|
||||
$this->argv = explode('/',$this->cmd);
|
||||
|
|
0
images/b_block.gif
Executable file → Normal file
Before Width: | Height: | Size: 83 B After Width: | Height: | Size: 83 B |
0
images/b_drop.gif
Executable file → Normal file
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
0
images/b_drop.png
Executable file → Normal file
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
0
images/b_drophide.gif
Executable file → Normal file
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
0
images/b_dropshow.gif
Executable file → Normal file
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
0
images/b_edit.gif
Executable file → Normal file
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
0
images/b_edit.png
Executable file → Normal file
Before Width: | Height: | Size: 451 B After Width: | Height: | Size: 451 B |
0
images/blue_flag_16.png
Executable file → Normal file
Before Width: | Height: | Size: 1,003 B After Width: | Height: | Size: 1,003 B |
0
images/camera-icon.gif
Executable file → Normal file
Before Width: | Height: | Size: 1,015 B After Width: | Height: | Size: 1,015 B |
0
images/default-profile-sm.jpg
Executable file → Normal file
Before Width: | Height: | Size: 346 B After Width: | Height: | Size: 346 B |
0
images/default-profile.jpg
Executable file → Normal file
Before Width: | Height: | Size: 490 B After Width: | Height: | Size: 490 B |
0
images/dfrn.gif
Executable file → Normal file
Before Width: | Height: | Size: 109 B After Width: | Height: | Size: 109 B |
0
images/dislike.gif
Executable file → Normal file
Before Width: | Height: | Size: 133 B After Width: | Height: | Size: 133 B |
0
images/friendica-32.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
images/friendika-128.jpg
Executable file → Normal file
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
0
images/friendika-128.png
Executable file → Normal file
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
0
images/friendika-16.ico
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
images/friendika-16.jpg
Executable file → Normal file
Before Width: | Height: | Size: 659 B After Width: | Height: | Size: 659 B |
0
images/friendika-16.png
Executable file → Normal file
Before Width: | Height: | Size: 699 B After Width: | Height: | Size: 699 B |
0
images/friendika-1600.png
Executable file → Normal file
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 280 KiB |
0
images/friendika-256.jpg
Executable file → Normal file
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
0
images/friendika-256.png
Executable file → Normal file
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
0
images/friendika-32.jpg
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
images/friendika-32.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
images/friendika-64.jpg
Executable file → Normal file
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
0
images/friendika-64.png
Executable file → Normal file
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
0
images/friendika.svg
Executable file → Normal file
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
0
images/larrow.gif
Executable file → Normal file
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
0
images/larrw.gif
Executable file → Normal file
Before Width: | Height: | Size: 1,004 B After Width: | Height: | Size: 1,004 B |
0
images/like.gif
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
images/link-icon.gif
Executable file → Normal file
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 145 B |
0
images/lock_icon.gif
Executable file → Normal file
Before Width: | Height: | Size: 932 B After Width: | Height: | Size: 932 B |
0
images/lrarrow.gif
Executable file → Normal file
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 236 B |
0
images/no.gif
Executable file → Normal file
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 631 B |
0
images/pen.png
Executable file → Normal file
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
0
images/penhover.png
Executable file → Normal file
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
0
images/rarrow.gif
Executable file → Normal file
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
0
images/rarrw.gif
Executable file → Normal file
Before Width: | Height: | Size: 999 B After Width: | Height: | Size: 999 B |
0
images/rotator.gif
Executable file → Normal file
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 826 B |
0
images/shield_2_16.png
Executable file → Normal file
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 974 B |
0
images/star.jpg
Executable file → Normal file
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
0
images/unlock_icon.gif
Executable file → Normal file
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();
|
||||
|