- background the external network notifications (Facebook, Twitter, Statusnet)
 - add vimeo support
 - consolidate editor video options (insert video, regardless of source)
 - add "Connector Settings" page purely for configuring connectors
 - moved mailbox settings to Connectors
 - Move the "Connect/Follow" dialogue out of "find people" and move to top.
 - Add "Find People" dialogue
 - minor theme edits on duepuntozero and testbubble to make all this stuff work
 - A bit of theming on duepunto notifications to eliminate the gigantic Diaspora profile photos.
This commit is contained in:
Friendika 2011-10-11 18:24:37 -07:00
parent caf18164f0
commit 557a7d0cec
25 changed files with 324 additions and 195 deletions

View file

@ -8,9 +8,9 @@ require_once("include/pgettext.php");
require_once('include/nav.php'); require_once('include/nav.php');
define ( 'FRIENDIKA_PLATFORM', 'Free Friendika'); define ( 'FRIENDIKA_PLATFORM', 'Free Friendika');
define ( 'FRIENDIKA_VERSION', '2.3.1130' ); define ( 'FRIENDIKA_VERSION', '2.3.1131' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1094 ); define ( 'DB_UPDATE_VERSION', 1095 );
define ( 'EOL', "<br />\r\n" ); define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );

View file

@ -193,6 +193,7 @@ CREATE TABLE IF NOT EXISTS `item` (
`object` text NOT NULL, `object` text NOT NULL,
`target-type` char(255) NOT NULL, `target-type` char(255) NOT NULL,
`target` text NOT NULL, `target` text NOT NULL,
`postopts` text NOT NULL,
`plink` char(255) NOT NULL, `plink` char(255) NOT NULL,
`resource-id` char(255) NOT NULL, `resource-id` char(255) NOT NULL,
`event-id` int(10) unsigned NOT NULL, `event-id` int(10) unsigned NOT NULL,

View file

@ -483,11 +483,7 @@
$txt = requestdata('htmlstatus'); $txt = requestdata('htmlstatus');
if((strpos($txt,'<') !== false) || (strpos($txt,'>') !== false)) { if((strpos($txt,'<') !== false) || (strpos($txt,'>') !== false)) {
$txt = preg_replace('#<object[^>]+>.+?' . 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s', $txt = html2bb_video($txt);
'[youtube]$1[/youtube]', $txt);
$txt = preg_replace('#<iframe[^>].+?' . 'http://www.youtube.com/embed/([A-Za-z0-9\-_=]+).+?</iframe>#s',
'[youtube]$1[/youtube]', $txt);
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
$config->set('Cache.DefinitionImpl', null); $config->set('Cache.DefinitionImpl', null);

View file

@ -141,6 +141,9 @@ function bbcode($Text,$preserve_nl = false) {
$Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="425" height="350" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text); $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="425" height="350" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text);
} }
$Text = preg_replace("/\[vimeo\]https?:\/\/player.vimeo.com\/video\/([0-9]+)(.*?)\[\/vimeo\]/ism",'[vimeo]$1[/vimeo]',$Text);
$Text = preg_replace("/\[vimeo\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/vimeo\]/ism",'[vimeo]$1[/vimeo]',$Text);
$Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '<iframe width="425" height="350" src="http://player.vimeo.com/video/$1" frameborder="0" ></iframe>', $Text);
// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text); // $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text);

View file

@ -745,9 +745,8 @@ function status_editor($a,$x, $notes_cid = 0) {
'$nickname' => $x['nickname'], '$nickname' => $x['nickname'],
'$ispublic' => t('Visible to <strong>everybody</strong>'), '$ispublic' => t('Visible to <strong>everybody</strong>'),
'$linkurl' => t('Please enter a link URL:'), '$linkurl' => t('Please enter a link URL:'),
'$utubeurl' => t('Please enter a YouTube link:'), '$vidurl' => t("Please enter a video link/URL:"),
'$vidurl' => t("Please enter a video\x28.ogg\x29 link/URL:"), '$audurl' => t("Please enter an audio link/URL:"),
'$audurl' => t("Please enter an audio\x28.ogg\x29 link/URL:"),
'$whereareu' => t('Where are you right now?'), '$whereareu' => t('Where are you right now?'),
'$title' => t('Enter a title for this item') '$title' => t('Enter a title for this item')
)); ));
@ -795,9 +794,8 @@ function status_editor($a,$x, $notes_cid = 0) {
'$upload' => t('Upload photo'), '$upload' => t('Upload photo'),
'$attach' => t('Attach file'), '$attach' => t('Attach file'),
'$weblink' => t('Insert web link'), '$weblink' => t('Insert web link'),
'$youtube' => t('Insert YouTube video'), '$video' => t('Insert video link'),
'$video' => t('Insert Vorbis [.ogg] video'), '$audio' => t('Insert audio link'),
'$audio' => t('Insert Vorbis [.ogg] audio'),
'$setloc' => t('Set your location'), '$setloc' => t('Set your location'),
'$noloc' => t('Clear browser location'), '$noloc' => t('Clear browser location'),
'$title' => t('Set title'), '$title' => t('Set title'),

View file

@ -414,11 +414,7 @@ function get_atom_elements($feed,$item) {
if((strpos($res['body'],'<') !== false) || (strpos($res['body'],'>') !== false)) { if((strpos($res['body'],'<') !== false) || (strpos($res['body'],'>') !== false)) {
$res['body'] = preg_replace('#<object[^>]+>.+?' . 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s', $res['body'] = html2bb_video($res['body']);
'[youtube]$1[/youtube]', $res['body']);
$res['body'] = preg_replace('#<iframe[^>].+?' . 'http://www.youtube.com/embed/([A-Za-z0-9\-_=]+).+?</iframe>#s',
'[youtube]$1[/youtube]', $res['body']);
$res['body'] = oembed_html2bbcode($res['body']); $res['body'] = oembed_html2bbcode($res['body']);
@ -586,12 +582,7 @@ function get_atom_elements($feed,$item) {
$res['object'] .= '<orig>' . xmlify($body) . '</orig>' . "\n"; $res['object'] .= '<orig>' . xmlify($body) . '</orig>' . "\n";
if((strpos($body,'<') !== false) || (strpos($body,'>') !== false)) { if((strpos($body,'<') !== false) || (strpos($body,'>') !== false)) {
$body = preg_replace('#<object[^>]+>.+?' . 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s', $body = html2bb_video($body);
'[youtube]$1[/youtube]', $body);
$res['body'] = preg_replace('#<iframe[^>].+?' . 'http://www.youtube.com/embed/([A-Za-z0-9\-_=]+).+?</iframe>#s',
'[youtube]$1[/youtube]', $res['body']);
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
$config->set('Cache.DefinitionImpl', null); $config->set('Cache.DefinitionImpl', null);
@ -629,11 +620,7 @@ function get_atom_elements($feed,$item) {
$res['object'] .= '<orig>' . xmlify($body) . '</orig>' . "\n"; $res['object'] .= '<orig>' . xmlify($body) . '</orig>' . "\n";
if((strpos($body,'<') !== false) || (strpos($body,'>') !== false)) { if((strpos($body,'<') !== false) || (strpos($body,'>') !== false)) {
$body = preg_replace('#<object[^>]+>.+?' . 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s', $body = html2bb_video($body);
'[youtube]$1[/youtube]', $body);
$res['body'] = preg_replace('#<iframe[^>].+?' . 'http://www.youtube.com/embed/([A-Za-z0-9\-_=]+).+?</iframe>#s',
'[youtube]$1[/youtube]', $res['body']);
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
$config->set('Cache.DefinitionImpl', null); $config->set('Cache.DefinitionImpl', null);

View file

@ -779,6 +779,12 @@ function notifier_run($argv, $argc){
} }
if($normal_mode)
call_hooks('notifier_normal',$target_item);
call_hooks('notifier_end',$target_item);
return; return;
} }

View file

@ -1003,3 +1003,37 @@ if (!function_exists('str_getcsv')) {
} }
} }
} }
function cleardiv() {
return '<div class="clear"></div>';
}
function bb_translate_video($s) {
$matches = null;
$r = preg_match_all("/\[video\](.*?)\[\/video\]/ism",$s,$matches,PREG_SET_ORDER);
if($r) {
foreach($matches as $mtch) {
if((stristr($mtch[1],'youtube')) || (stristr($mtch[1],'youtu.be')))
$s = str_replace($mtch[0],'[youtube]' . $mtch[1] . '[/youtube]',$s);
elseif(stristr($mtch[1],'vimeo'))
$s = str_replace($mtch[0],'[vimeo]' . $mtch[1] . '[/vimeo]',$s);
}
}
return $s;
}
function html2bb_video($s) {
$s = preg_replace('#<object[^>]+>(.*?)https+://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+)(.*?)</object>#ism',
'[youtube]$2[/youtube]', $s);
$s = preg_replace('#<iframe[^>](.*?)https+://www.youtube.com/embed/([A-Za-z0-9\-_=]+)(.*?)</iframe>#ism',
'[youtube]$2[/youtube]', $s);
$s = preg_replace('#<iframe[^>](.*?)https+://player.vimeo.com/video/([0-9]+)(.*?)</iframe>#ism',
'[vimeo]$2[/vimeo]', $s);
return $s;
}

View file

@ -21,6 +21,16 @@ function contacts_init(&$a) {
require_once('include/group.php'); require_once('include/group.php');
if(! x($a->page,'aside')) if(! x($a->page,'aside'))
$a->page['aside'] = ''; $a->page['aside'] = '';
$a->page['aside'] .= replace_macros(get_markup_template('follow.tpl'),array(
'$connect' => t('Add New Contact'),
'$desc' => t('Enter address or web location'),
'$hint' => t('Example: bob@example.com, http://example.com/barbara'),
'$follow' => t('Connect')
));
$a->page['aside'] .= group_side('contacts','group',false,0,$contact_id); $a->page['aside'] .= group_side('contacts','group',false,0,$contact_id);
if(get_config('system','invitation_only')) { if(get_config('system','invitation_only')) {
@ -32,22 +42,18 @@ function contacts_init(&$a) {
} }
} }
$tpl = get_markup_template('follow.tpl'); $tpl = get_markup_template('peoplefind.tpl');
$findSimilarLink = '<div class="side-link" id="side-match-link"><a href="match" >' $inv = (($a->config['register_policy'] != REGISTER_CLOSED) ? t('Invite Friends') : '');
. t('Similar Interests') . '</a></div>';
$inv = '';
if($a->config['register_policy'] != REGISTER_CLOSED) {
$inv = '<div class="side-link" id="side-invite-link" ><a href="invite" >' . t("Invite Friends") . '</a></div>';
}
$a->page['aside'] .= replace_macros($tpl,array( $a->page['aside'] .= replace_macros($tpl,array(
'$findpeople' => t('Find People'),
'$desc' => t('Enter name or interest'),
'$label' => t('Connect/Follow'), '$label' => t('Connect/Follow'),
'$hint' => t('Example: bob@example.com, http://example.com/barbara'), '$hint' => t('Examples: Robert Morgenstein, Fishing'),
'$follow' => t('Follow'), '$findthem' => t('Find'),
'$findSimilar' => $findSimilarLink, '$similar' => t('Similar Interests'),
'$inviteFriends' => $inv '$inv' => $inv
)); ));
@ -351,6 +357,7 @@ function contacts_content(&$a) {
'$hide_url' => ((strlen($sql_extra)) ? 'contacts/all' : 'contacts' ), '$hide_url' => ((strlen($sql_extra)) ? 'contacts/all' : 'contacts' ),
'$hide_text' => ((strlen($sql_extra)) ? t('Show Blocked Connections') : t('Hide Blocked Connections')), '$hide_text' => ((strlen($sql_extra)) ? t('Show Blocked Connections') : t('Hide Blocked Connections')),
'$search' => $search, '$search' => $search,
'$desc' => t('Search your contacts'),
'$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : ""), '$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : ""),
'$submit' => t('Find'), '$submit' => t('Find'),
'$cmd' => $a->cmd '$cmd' => $a->cmd

View file

@ -1,13 +1,13 @@
<?php <?php
function tagmatch_content(&$a) { function dirfind_content(&$a) {
$search = notags(trim($_REQUEST['search'])); $search = notags(trim($_REQUEST['search']));
$o = ''; $o = '';
$o .= '<h2>' . t('Tag Match') . ' - ' . $search . '</h2>'; $o .= '<h2>' . t('People Search') . ' - ' . $search . '</h2>';
if($search) { if($search) {

View file

@ -342,6 +342,8 @@ function item_post(&$a) {
} }
$body = bb_translate_video($body);
/** /**
* Fold multi-line [code] sequences * Fold multi-line [code] sequences
*/ */
@ -522,6 +524,7 @@ function item_post(&$a) {
$datarray['attach'] = $attachments; $datarray['attach'] = $attachments;
$datarray['bookmark'] = intval($bookmark); $datarray['bookmark'] = intval($bookmark);
$datarray['thr-parent'] = $thr_parent; $datarray['thr-parent'] = $thr_parent;
$datarray['postopts'] = '';
/** /**
* These fields are for the convenience of plugins... * These fields are for the convenience of plugins...
@ -531,7 +534,7 @@ function item_post(&$a) {
$datarray['parent'] = $parent; $datarray['parent'] = $parent;
$datarray['self'] = $self; $datarray['self'] = $self;
$datarray['prvnets'] = $user['prvnets']; // $datarray['prvnets'] = $user['prvnets'];
if($orig_post) if($orig_post)
$datarray['edit'] = true; $datarray['edit'] = true;
@ -563,8 +566,8 @@ function item_post(&$a) {
$r = q("INSERT INTO `item` (`guid`, `uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, $r = q("INSERT INTO `item` (`guid`, `uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `commented`, `received`, `changed`, `uri`, `thr-parent`, `title`, `body`, `app`, `location`, `coord`, `author-name`, `author-link`, `author-avatar`, `created`, `edited`, `commented`, `received`, `changed`, `uri`, `thr-parent`, `title`, `body`, `app`, `location`, `coord`,
`tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `attach`, `bookmark` ) `tag`, `inform`, `verb`, `postopts`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `attach`, `bookmark` )
VALUES( '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d )", VALUES( '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d )",
dbesc($datarray['guid']), dbesc($datarray['guid']),
intval($datarray['uid']), intval($datarray['uid']),
dbesc($datarray['type']), dbesc($datarray['type']),
@ -592,6 +595,7 @@ function item_post(&$a) {
dbesc($datarray['tag']), dbesc($datarray['tag']),
dbesc($datarray['inform']), dbesc($datarray['inform']),
dbesc($datarray['verb']), dbesc($datarray['verb']),
dbesc($datarray['postopts']),
dbesc($datarray['allow_cid']), dbesc($datarray['allow_cid']),
dbesc($datarray['allow_gid']), dbesc($datarray['allow_gid']),
dbesc($datarray['deny_cid']), dbesc($datarray['deny_cid']),

View file

@ -59,6 +59,7 @@ function match_content(&$a) {
} }
$o .= cleardiv();
$o .= paginate($a); $o .= paginate($a);
return $o; return $o;
} }

View file

@ -165,7 +165,7 @@ function ping_init(&$a) {
} }
if (count($friends)){ if (count($friends)){
foreach ($friends as $i) { foreach ($friends as $i) {
echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} is now friends with %s"), $i['fname'] ) ); echo xmlize($a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'],$i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} is now friends with %s"), $i['fname'] ) );
}; };
} }
if (count($posts)){ if (count($posts)){
@ -180,16 +180,14 @@ function ping_init(&$a) {
if(x($_SESSION,'sysmsg')){ if(x($_SESSION,'sysmsg')){
foreach ($_SESSION['sysmsg'] as $m){ foreach ($_SESSION['sysmsg'] as $m){
echo "<notice>".($m)."</notice>"; echo "<notice>".xmlify($m)."</notice>";
} }
//$_SESSION['sysmsg']=array();
unset($_SESSION['sysmsg']); unset($_SESSION['sysmsg']);
} }
if(x($_SESSION,'sysmsg_info')){ if(x($_SESSION,'sysmsg_info')){
foreach ($_SESSION['sysmsg_info'] as $m){ foreach ($_SESSION['sysmsg_info'] as $m){
echo "<info>".($m)."</info>"; echo "<info>".xmlify($m)."</info>";
} }
//$_SESSION['sysmsg_info']=array();
unset($_SESSION['sysmsg_info']); unset($_SESSION['sysmsg_info']);
} }

View file

@ -52,6 +52,78 @@ function settings_post(&$a) {
return; return;
} }
if(($a->argc > 1) && ($a->argv[1] == 'connectors')) {
if(x($_POST['imap-submit'])) {
$mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : '');
$mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : '');
$mail_ssl = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : '');
$mail_user = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : '');
$mail_pass = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : '');
$mail_replyto = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : '');
$mail_pubmail = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : '');
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
if(get_config('system','dfrn_only'))
$mail_disabled = 1;
if(! $mail_disabled) {
$failed = false;
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval(local_user())
);
if(! count($r)) {
q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
intval(local_user())
);
}
if(strlen($mail_pass)) {
$pass = '';
openssl_public_encrypt($mail_pass,$pass,$a->user['pubkey']);
q("UPDATE `mailacct` SET `pass` = '%s' WHERE `uid` = %d LIMIT 1",
dbesc(bin2hex($pass)),
intval(local_user())
);
}
$r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
`mailbox` = 'INBOX', `reply_to` = '%s', `pubmail` = %d WHERE `uid` = %d LIMIT 1",
dbesc($mail_server),
intval($mail_port),
dbesc($mail_ssl),
dbesc($mail_user),
dbesc($mail_replyto),
intval($mail_pubmail),
intval(local_user())
);
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval(local_user())
);
if(count($r)) {
$eacct = $r[0];
require_once('include/email.php');
$mb = construct_mailbox_name($eacct);
if(strlen($eacct['server'])) {
$dcrpass = '';
openssl_private_decrypt(hex2bin($eacct['pass']),$dcrpass,$a->user['prvkey']);
$mbox = email_connect($mb,$mail_user,$dcrpass);
unset($dcrpass);
if(! $mbox) {
$failed = true;
notice( t('Failed to connect with email account using the settings provided.') . EOL);
}
}
}
if(! $failed)
info( t('Email settings updated.') . EOL);
}
}
call_hooks('connector_settings_post', $_POST);
return;
}
call_hooks('settings_post', $_POST); call_hooks('settings_post', $_POST);
if((x($_POST,'npassword')) || (x($_POST,'confirm'))) { if((x($_POST,'npassword')) || (x($_POST,'confirm'))) {
@ -103,66 +175,6 @@ function settings_post(&$a) {
$hidewall = (($_POST['hidewall'] == 1) ? 1: 0); $hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
$mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : '');
$mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : '');
$mail_ssl = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : '');
$mail_user = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : '');
$mail_pass = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : '');
$mail_replyto = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : '');
$mail_pubmail = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : '');
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
if(get_config('system','dfrn_only'))
$mail_disabled = 1;
if(! $mail_disabled) {
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval(local_user())
);
if(! count($r)) {
q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
intval(local_user())
);
}
if(strlen($mail_pass)) {
$pass = '';
openssl_public_encrypt($mail_pass,$pass,$a->user['pubkey']);
q("UPDATE `mailacct` SET `pass` = '%s' WHERE `uid` = %d LIMIT 1",
dbesc(bin2hex($pass)),
intval(local_user())
);
}
$r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
`mailbox` = 'INBOX', `reply_to` = '%s', `pubmail` = %d WHERE `uid` = %d LIMIT 1",
dbesc($mail_server),
intval($mail_port),
dbesc($mail_ssl),
dbesc($mail_user),
dbesc($mail_replyto),
intval($mail_pubmail),
intval(local_user())
);
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval(local_user())
);
if(count($r)) {
$eacct = $r[0];
require_once('include/email.php');
$mb = construct_mailbox_name($eacct);
if(strlen($eacct['server'])) {
$dcrpass = '';
openssl_private_decrypt(hex2bin($eacct['pass']),$dcrpass,$a->user['prvkey']);
$mbox = email_connect($mb,$mail_user,$dcrpass);
unset($dcrpass);
if(! $mbox)
notice( t('Failed to connect with email account using the settings provided.') . EOL);
}
}
}
$notify = 0; $notify = 0;
if(x($_POST,'notify1')) if(x($_POST,'notify1'))
@ -312,10 +324,20 @@ function settings_content(&$a) {
'url' => $a->get_baseurl().'/settings', 'url' => $a->get_baseurl().'/settings',
'sel' => (($a->argc == 1)?'active':''), 'sel' => (($a->argc == 1)?'active':''),
), ),
array(
'label' => t('Connector settings'),
'url' => $a->get_baseurl().'/settings/connectors',
'sel' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
),
array( array(
'label' => t('Plugin settings'), 'label' => t('Plugin settings'),
'url' => $a->get_baseurl().'/settings/addon', 'url' => $a->get_baseurl().'/settings/addon',
'sel' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''), 'sel' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
),
array(
'label' => t('Export personal data'),
'url' => $a->get_baseurl() . '/uexport',
'sel' => ''
) )
); );
@ -344,6 +366,66 @@ function settings_content(&$a) {
)); ));
return $o; return $o;
} }
if(($a->argc > 1) && ($a->argv[1] === 'connectors')) {
$settings_connectors = "";
call_hooks('connector_settings', $settings_connectors);
$diasp_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('Diaspora'), ((get_config('system','diaspora_enabled')) ? t('enabled') : t('disabled')));
$ostat_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('StatusNet'), ((get_config('system','ostatus_disabled')) ? t('disabled') : t('enabled')));
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
if(get_config('system','dfrn_only'))
$mail_disabled = 1;
if(! $mail_disabled) {
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
local_user()
);
}
else {
$r = null;
}
$mail_server = ((count($r)) ? $r[0]['server'] : '');
$mail_port = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
$mail_ssl = ((count($r)) ? $r[0]['ssltype'] : '');
$mail_user = ((count($r)) ? $r[0]['user'] : '');
$mail_replyto = ((count($r)) ? $r[0]['reply_to'] : '');
$mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
$mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
$tpl = get_markup_template("settings_connectors.tpl");
$o .= replace_macros($tpl, array(
'$title' => t('Connector Settings'),
'$tabs' => $tabs,
'$diasp_enabled' => $diasp_enabled,
'$ostat_enabled' => $ostat_enabled,
'$h_imap' => t('Email/Mailbox Setup'),
'$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
'$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''),
'$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''),
'$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''),
'$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''),
'$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( ''=>t('None'), 'TSL'=>'TSL', 'SSL'=>'SSL')),
'$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''),
'$mail_pass' => array('mail_pass', t('Email password:'), '', ''),
'$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'),
'$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''),
'$submit' => t('Submit'),
'$settings_connectors' => $settings_connectors
));
return $o;
}
require_once('include/acl_selectors.php'); require_once('include/acl_selectors.php');
@ -368,26 +450,6 @@ function settings_content(&$a) {
$timezone = date_default_timezone_get(); $timezone = date_default_timezone_get();
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
if(get_config('system','dfrn_only'))
$mail_disabled = 1;
if(! $mail_disabled) {
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
local_user()
);
}
else {
$r = null;
}
$mail_server = ((count($r)) ? $r[0]['server'] : '');
$mail_port = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
$mail_ssl = ((count($r)) ? $r[0]['ssltype'] : '');
$mail_user = ((count($r)) ? $r[0]['user'] : '');
$mail_replyto = ((count($r)) ? $r[0]['reply_to'] : '');
$mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
$mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
$pageset_tpl = get_markup_template('pagetypes.tpl'); $pageset_tpl = get_markup_template('pagetypes.tpl');
$pagetype = replace_macros($pageset_tpl,array( $pagetype = replace_macros($pageset_tpl,array(
@ -496,8 +558,6 @@ function settings_content(&$a) {
'$uid' => local_user(), '$uid' => local_user(),
'$nickname_block' => $prof_addr, '$nickname_block' => $prof_addr,
'$uexport' => t('Export Personal Data'),
'$h_pass' => t('Password Settings'), '$h_pass' => t('Password Settings'),
'$password1'=> array('npassword', t('New Password:'), '', ''), '$password1'=> array('npassword', t('New Password:'), '', ''),
@ -543,21 +603,6 @@ function settings_content(&$a) {
'$h_imap' => t('Email/Mailbox Setup'),
'$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
'$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $imap_last_check,''),
'$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''),
'$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''),
'$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''),
'$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( ''=>t('None'), 'TSL'=>'TSL', 'SSL'=>'SSL')),
'$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''),
'$mail_pass' => array('mail_pass', t('Email password:'), '', ''),
'$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'),
'$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''),
'$h_advn' => t('Advanced Page Settings'), '$h_advn' => t('Advanced Page Settings'),
'$pagetype' => $pagetype, '$pagetype' => $pagetype,

View file

@ -1,6 +1,6 @@
<?php <?php
define( 'UPDATE_VERSION' , 1094 ); define( 'UPDATE_VERSION' , 1095 );
/** /**
* *
@ -786,4 +786,8 @@ function update_1093() {
q("ALTER TABLE `group` ADD `visible` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `uid` "); q("ALTER TABLE `group` ADD `visible` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `uid` ");
} }
function update_1094() {
q("ALTER TABLE `item` ADD `postopts` TEXT NOT NULL AFTER `target` ");
}

View file

@ -4,6 +4,7 @@ $finding
<div id="contacts-search-wrapper"> <div id="contacts-search-wrapper">
<form id="contacts-search-form" action="$cmd" method="get" > <form id="contacts-search-form" action="$cmd" method="get" >
<span class="contacts-search-desc">$desc</span>
<input type="text" name="search" id="contacts-search" class="search-input" onfocus="this.select();" value="$search" /> <input type="text" name="search" id="contacts-search" class="search-input" onfocus="this.select();" value="$search" />
<input type="submit" name="submit" id="contacts-search-submit" value="$submit" /> <input type="submit" name="submit" id="contacts-search-submit" value="$submit" />
</form> </form>

View file

@ -1,9 +1,8 @@
<div id="follow-sidebar" class="widget"> <div id="follow-sidebar" class="widget">
<h3>Find People</h3> <h3>$connect</h3>
<div id="connect-desc">$desc</div>
<form action="follow" method="post" /> <form action="follow" method="post" />
<input id="side-follow-url" type="text" name="url" size="24" title="$hint" /><input id="side-follow-submit" type="submit" name="submit" value="$follow" /> <input id="side-follow-url" type="text" name="url" size="24" title="$hint" /><input id="side-follow-submit" type="submit" name="submit" value="$follow" />
</form> </form>
$findSimilar
$inviteFriends
</div> </div>

View file

@ -149,13 +149,6 @@ function initEditor(cb){
} }
} }
function jotGetVideo() {
reply = prompt("$utubeurl");
if(reply && reply.length) {
tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
}
}
function jotVideoURL() { function jotVideoURL() {
reply = prompt("$vidurl"); reply = prompt("$vidurl");
if(reply && reply.length) { if(reply && reply.length) {

View file

@ -32,9 +32,6 @@
<div id="profile-link-wrapper" style="display: $visitor;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" > <div id="profile-link-wrapper" style="display: $visitor;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" >
<a id="profile-link" class="icon link" title="$weblink" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"></a> <a id="profile-link" class="icon link" title="$weblink" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"></a>
</div> </div>
<div id="profile-youtube-wrapper" style="display: $visitor;" >
<a id="profile-youtube" class="icon youtube" title="$youtube" onclick="jotGetVideo();return false;"></a>
</div>
<div id="profile-video-wrapper" style="display: $visitor;" > <div id="profile-video-wrapper" style="display: $visitor;" >
<a id="profile-video" class="icon video" title="$video" onclick="jotVideoURL();return false;"></a> <a id="profile-video" class="icon video" title="$video" onclick="jotVideoURL();return false;"></a>
</div> </div>

12
view/peoplefind.tpl Normal file
View file

@ -0,0 +1,12 @@
<div id="peoplefind-sidebar" class="widget">
<h3>$findpeople</h3>
<div id="peoplefind-desc">$desc</div>
<form action="dirfind" method="post" />
<input id="side-peoplefind-url" type="text" name="search" size="24" title="$hint" /><input id="side-peoplefind-submit" type="submit" name="submit" value="$findthem" />
</form>
<div class="side-link" id="side-match-link"><a href="match" >$similar</a></div>
{{ if $inv }}
<div class="side-link" id="side-invite-link" ><a href="invite" >$inv</a></div>
{{ endif }}
</div>

View file

@ -4,9 +4,6 @@ $tabs
$nickname_block $nickname_block
<div id="uexport-link"><a href="uexport" >$uexport</a></div>
<form action="settings" id="settings-form" method="post" autocomplete="off" > <form action="settings" id="settings-form" method="post" autocomplete="off" >
@ -95,27 +92,6 @@ $hide_wall
<input type="submit" name="submit" class="settings-submit" value="$submit" /> <input type="submit" name="submit" class="settings-submit" value="$submit" />
</div> </div>
{{ if $mail_disabled }}
{{ else }}
<h3 class="settings-heading">$h_imap</h3>
<p>$imap_desc</p>
{{inc field_custom.tpl with $field=$imap_lastcheck }}{{endinc}}
{{inc field_input.tpl with $field=$mail_server }}{{endinc}}
{{inc field_input.tpl with $field=$mail_port }}{{endinc}}
{{inc field_select.tpl with $field=$mail_ssl }}{{endinc}}
{{inc field_input.tpl with $field=$mail_user }}{{endinc}}
{{inc field_password.tpl with $field=$mail_pass }}{{endinc}}
{{inc field_input.tpl with $field=$mail_replyto }}{{endinc}}
{{inc field_checkbox.tpl with $field=$mail_pubmail }}{{endinc}}
<div class="settings-submit-wrapper" >
<input type="submit" name="submit" class="settings-submit" value="$submit" />
</div>
{{ endif }}
<h3 class="settings-heading">$h_advn</h3> <h3 class="settings-heading">$h_advn</h3>

View file

@ -3,7 +3,7 @@ $tabs
<h1>$title</h1> <h1>$title</h1>
<form action="settings/addon" method="post" > <form action="settings/addon" method="post" autocomplete="off">
$settings_addons $settings_addons

View file

@ -0,0 +1,34 @@
$tabs
<h1>$title</h1>
<div class="connector_statusmsg">$diasp_enabled</div>
<div class="connector_statusmsg">$ostat_enabled</div>
<form action="settings/connectors" method="post" autocomplete="off">
$settings_connectors
{{ if $mail_disabled }}
{{ else }}
<div class="settings-block">
<h3 class="settings-heading">$h_imap</h3>
<p>$imap_desc</p>
{{inc field_custom.tpl with $field=$imap_lastcheck }}{{endinc}}
{{inc field_input.tpl with $field=$mail_server }}{{endinc}}
{{inc field_input.tpl with $field=$mail_port }}{{endinc}}
{{inc field_select.tpl with $field=$mail_ssl }}{{endinc}}
{{inc field_input.tpl with $field=$mail_user }}{{endinc}}
{{inc field_password.tpl with $field=$mail_pass }}{{endinc}}
{{inc field_input.tpl with $field=$mail_replyto }}{{endinc}}
{{inc field_checkbox.tpl with $field=$mail_pubmail }}{{endinc}}
<div class="settings-submit-wrapper" >
<input type="submit" id="imap-submit" name="imap-submit" class="settings-submit" value="$submit" />
</div>
</div>
{{ endif }}
</form>

View file

@ -145,7 +145,6 @@ nav .nav-link {
background-color: transparent !important; background-color: transparent !important;
} }
.nav-commlink.selected { .nav-commlink.selected {
background-color: #ffffff; background-color: #ffffff;
border-bottom: 1px solid #ffffff; border-bottom: 1px solid #ffffff;
@ -1849,13 +1848,28 @@ a.mail-list-link {
#side-follow-wrapper { #side-follow-wrapper {
margin-top: 20px; margin-top: 20px;
} }
#side-follow-url { #side-follow-url, #side-peoplefind-url {
margin-top: 5px; margin-top: 5px;
} }
#side-follow-submit { #side-follow-submit, #side-peoplefind-submit {
margin-top: 15px; margin-top: 15px;
} }
#side-match-link {
margin-top: 10px;
}
.widget {
border: 1px solid #DDDDDD;
padding: 5px;
margin-top: 5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
}
.photo-album-image-wrapper { .photo-album-image-wrapper {
float: left; float: left;
margin-top: 15px; margin-top: 15px;
@ -2641,8 +2655,8 @@ a.mail-list-link {
border-color:#204A87; border-color:#204A87;
padding-right: 40px; padding-right: 40px;
background-position: right center; background-position: right center;
background-color: #3465A4; background-color: #D7E3F1;
color: #FFFFFF; color: #204A87;
text-align: left; text-align: left;
} }
.hidden { display: none!important; } .hidden { display: none!important; }

View file

@ -823,7 +823,7 @@ profile-jot-banner-wrapper {
/* ======== */ /* ======== */
.tabs { .tabs {
width: 450px; width: 600px;
list-style: none; list-style: none;
padding: 10px; padding: 10px;
margin: 0px 0px 10px 0px; margin: 0px 0px 10px 0px;
@ -2211,6 +2211,25 @@ margin-left: 0px;
padding: 5px; padding: 5px;
} }
.settings-block {
margin-top: 20px;
-moz-box-shadow: 1px 2px 6px 0px #959494;
-webkit-box-shadow: 1px 2px 6px 0px #959494;
box-shadow: 1px 2px 6px 0px #959494;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f8f8f8), color-stop(1, #f6f6f6) );
background:-moz-linear-gradient( center top, #f8f8f8 5%, #f6f6f6 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f8f8f8', endColorstr='#f6f6f6');
background-color:#f8f8f8;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
border:1px solid #eee;
color:#a6a6a6;
text-shadow:-1px 0px 0px #bdbdbd;
border: 1px solid #cdcdcd;
padding: 5px;
}
#register-form div, #register-form div,
#profile-edit-form div { #profile-edit-form div {
clear: both; clear: both;