diff --git a/INSTALL b/INSTALL index ceb73c3b9c..577f3f354c 100644 --- a/INSTALL +++ b/INSTALL @@ -23,6 +23,7 @@ encryption support - PHP *command line* access with register_argc_argv set to true in the php.ini file - curl, gd, mysql, and openssl extensions + - some form of email server or email gateway such that PHP mail() works - mcrypt (optional; used for end-to-end message encryption) - Mysql 5.x diff --git a/boot.php b/boot.php index 1870e059e9..9cc4d0f34f 100644 --- a/boot.php +++ b/boot.php @@ -2,7 +2,7 @@ set_time_limit(0); -define ( 'BUILD_ID', 1024 ); +define ( 'BUILD_ID', 1027 ); define ( 'DFRN_PROTOCOL_VERSION', '2.0' ); define ( 'EOL', "
\r\n" ); @@ -174,8 +174,10 @@ class App { public $pager; public $strings; public $path; + public $hooks; public $interactive = true; + private $scheme; private $hostname; private $baseurl; @@ -1924,7 +1926,7 @@ function profile_sidebar($profile) { $gender = ((x($profile,'gender') == 1) ? '
' . t('Gender:') . ' ' . $profile['gender'] . '
' : ''); - $pubkey = ((x($profile,'key') == 1) ? '' : ''); + $pubkey = ((x($profile,'pubkey') == 1) ? '' : ''); $marital = ((x($profile,'marital') == 1) ? '
' . t('Status:') . ' ' . $profile['marital'] . '
' : ''); @@ -1945,4 +1947,58 @@ function profile_sidebar($profile) { )); return $o; -}} \ No newline at end of file +}} + + +if(! function_exists('register_hook')) { +function register_hook($hook,$file,$function) { + + $r = q("INSERT INTO `hook` (`hook`, `file`, `function`) VALUES ( '%s', '%s', '%s' ) ", + dbesc($hook), + dbesc($file), + dbesc($function) + ); + return $r; +}} + +if(! function_exists('unregister_hook')) { +function unregister_hook($hook,$file,$function) { + + $r = q("DELETE FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' LIMIT 1", + dbesc($hook), + dbesc($file), + dbesc($function) + ); + return $r; +}} + + +if(! function_exists('load_hooks')) { +function load_hooks() { + $a = get_app(); + $r = q("SELECT * FROM `hook` WHERE 1"); + if(count($r)) { + foreach($r as $rr) { + $a->hooks[] = array($rr['hook'], $rr['file'], $rr['function']); + } + } +}} + + +if(! function_exists('call_hooks')) { +function call_hooks($name, $data = null) { + $a = get_app(); + + if(count($a->hooks)) { + foreach($a->hooks as $hook) { + if($hook[0] === $name) { + @require_once($hook[1]); + if(function_exists($hook[2])) { + $func = $hook[2]; + $func($a,$data); + } + } + } + } +}} + diff --git a/database.sql b/database.sql index dab7c179d9..08902d8930 100644 --- a/database.sql +++ b/database.sql @@ -292,6 +292,7 @@ CREATE TABLE IF NOT EXISTS `profile` ( `sexual` char(255) NOT NULL, `politic` char(255) NOT NULL, `religion` char(255) NOT NULL, + `keywords` text NOT NULL, `about` text NOT NULL, `summary` char(255) NOT NULL, `music` text NOT NULL, @@ -371,6 +372,7 @@ CREATE TABLE IF NOT EXISTS `user` ( `notify-flags` int(11) unsigned NOT NULL DEFAULT '65535', `page-flags` int(11) unsigned NOT NULL DEFAULT '0', `pwdreset` char(255) NOT NULL, + `maxreq` int(11) NOT NULL DEFAULT '10', `allow_cid` mediumtext NOT NULL, `allow_gid` mediumtext NOT NULL, `deny_cid` mediumtext NOT NULL, @@ -431,3 +433,11 @@ CREATE TABLE IF NOT EXISTS `pconfig` ( ) ENGINE = MYISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `hook` ( +`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`hook` CHAR( 255 ) NOT NULL , +`file` CHAR( 255 ) NOT NULL , +`function` CHAR( 255 ) NOT NULL +) ENGINE = MYISAM DEFAULT CHARSET=utf8; + + diff --git a/include/profile_selectors.php b/include/profile_selectors.php index f4b30f2118..92579f64aa 100644 --- a/include/profile_selectors.php +++ b/include/profile_selectors.php @@ -16,7 +16,7 @@ function gender_selector($current="",$suffix="") { function sexpref_selector($current="",$suffix="") { $o = ''; - $select = array('', t('Males'), t('Females'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual')); + $select = array('', t('Males'), t('Females'), t('Gay'), t('Lesbian'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual')); $o .= " +
(Used for searching public profiles, never shown to others)
+
+ +
diff --git a/view/en/settings.tpl b/view/en/settings.tpl index 095dd70a4a..85587afbfa 100644 --- a/view/en/settings.tpl +++ b/view/en/settings.tpl @@ -54,15 +54,27 @@ $theme -

Privacy Settings

+

Security and Privacy Settings

+
+ + +
(to prevent spam abuse)
+
+
+ + + + $profile_in_dir $profile_in_net_dir + +
diff --git a/view/theme/default/style.css b/view/theme/default/style.css index 491486794f..8ad6ee5936 100644 --- a/view/theme/default/style.css +++ b/view/theme/default/style.css @@ -496,6 +496,7 @@ input#dfrn-url { #settings-password-end, #settings-confirm-end, #settings-openid-end, +#settings-maxreq-end, #notify1-end, #notify2-end, #notify3-end, @@ -515,6 +516,7 @@ input#dfrn-url { #settings-password-label, #settings-confirm-label, #settings-openid-label, +#settings-maxreq-label, #settings-label-notify1, #settings-label-notify2, #settings-label-notify3, @@ -533,6 +535,7 @@ input#dfrn-url { #theme-select, #settings-password, #settings-confirm, +#settings-maxreq, #notify1, #notify2, #notify3, @@ -548,7 +551,10 @@ input#dfrn-url { width: 127px; } - +#settings-maxreq-desc { + float: left; + margin-left: 20px; +} #settings-theme-label, #settings-defloc-label { @@ -720,6 +726,7 @@ input#dfrn-url { #profile-edit-sexual-label, #profile-edit-politic-label, #profile-edit-religion-label, +#profile-edit-keywords-label, #profile-edit-homepage-label { float: left; width: 175px; @@ -738,6 +745,7 @@ input#dfrn-url { #sexual-select, #profile-edit-politic, #profile-edit-religion, +#profile-edit-keywords, #profile-in-dir-yes, #profile-in-dir-no, #profile-in-netdir-yes, @@ -768,6 +776,12 @@ input#dfrn-url { margin-left: 20px; } +#profile-edit-keywords-desc { + float: left; + margin-left: 20px; +} + + #profile-edit-homepage { float: left; margin-bottom: 35px; @@ -800,6 +814,7 @@ input#dfrn-url { #profile-edit-sexual-end, #profile-edit-politic-end, #profile-edit-religion-end, +#profile-edit-keywords-end, #profile-edit-homepage-end, #profile-in-dir-break, #profile-in-dir-end,