diff --git a/addon/calc/calc.php b/addon/calc/calc.php index a095e3960d..8c079dc7a5 100644 --- a/addon/calc/calc.php +++ b/addon/calc/calc.php @@ -1,4 +1,11 @@ + */ + function calc_install() { register_hook('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); diff --git a/addon/convert/convert.php b/addon/convert/convert.php index a3448ce01e..7a4c90a530 100644 --- a/addon/convert/convert.php +++ b/addon/convert/convert.php @@ -1,5 +1,10 @@ + */ function convert_install() { register_hook('app_menu', 'addon/convert/convert.php', 'convert_app_menu'); diff --git a/addon/facebook/README b/addon/facebook/README new file mode 100644 index 0000000000..42ec01383c --- /dev/null +++ b/addon/facebook/README @@ -0,0 +1,33 @@ +Installing the Friendika/Facebook connector + +1. register an API key for your site from developer.facebook.com + a. We'd be very happy if you include "Friendika" in the application name + to increase name recognition. The Friendika icons are also present + in the images directory and may be uploaded as a Facebook app icon. + Use images/friendika-16.jpg for the Icon and images/friendika-128.jpg for the Logo. + b. The url should be your site URL with a trailing slash. + You may use http://portal.friendika.com/privacy as the privacy policy + URL unless your site has different requirements, and + http://portal.friendika.com as the Terms of Service URL unless + you have different requirements. (Friendika is a software application + and does not require Terms of Service, though your installation of it might). + c. Set the following values in your .htconfig.php file + $a->config['facebook']['appid'] = 'xxxxxxxxxxx'; + $a->config['facebook']['appsecret'] = 'xxxxxxxxxxxxxxx'; + Replace with the settings Facebook gives you. +2. Enable the facebook plugin by including it in .htconfig.php - e.g. + $a->config['system']['addon'] = 'plugin1,plugin2,facebook'; +3. Visit the Facebook Settings section of the "Settings->Plugin Settings" page. + and click 'Install Facebook Connector'. +4. This will ask you to login to Facebook and grant permission to the + plugin to do its stuff. Allow it to do so. +5. You're done. To turn it off visit the Plugin Settings page again and + 'Remove Facebook posting'. + +Vidoes and embeds will not be posted if there is no other content. Links +and images will be converted to a format suitable for the Facebook API and +long posts truncated - with a link to view the full post. + +Facebook contacts will not be able to view private photos, as they are not able to +authenticate to your site to establish identity. We will address this +in a future release. diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index 545779cd5f..5d86c66c2c 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -1,4 +1,9 @@ + */ /** * Installing the Friendika/Facebook connector diff --git a/addon/fortunate/fortunate.php b/addon/fortunate/fortunate.php index b91080f516..5a6302e58d 100644 --- a/addon/fortunate/fortunate.php +++ b/addon/fortunate/fortunate.php @@ -1,7 +1,10 @@ + */ function fortunate_install() { diff --git a/addon/java_upload/java_upload.php b/addon/java_upload/java_upload.php index 8b8a57604c..09e321f0a8 100644 --- a/addon/java_upload/java_upload.php +++ b/addon/java_upload/java_upload.php @@ -1,5 +1,12 @@ + */ + /** * * Java photo uploader, uses Jumploader @@ -93,4 +100,4 @@ function java_upload_photo_post_end(&$a,&$b) { if(x($a->data,'java_upload') && $a->data['java_upload']) killme(); -} \ No newline at end of file +} diff --git a/addon/js_upload/js_upload.php b/addon/js_upload/js_upload.php index 9f3fa96009..042e9a988a 100644 --- a/addon/js_upload/js_upload.php +++ b/addon/js_upload/js_upload.php @@ -1,5 +1,12 @@ + */ + /** * * JavaScript Photo/Image Uploader diff --git a/addon/ldapauth/README b/addon/ldapauth/README new file mode 100644 index 0000000000..cf28ef1e06 --- /dev/null +++ b/addon/ldapauth/README @@ -0,0 +1,17 @@ +Authenticate a user against an LDAP directory +Useful for Windows Active Directory and other LDAP-based organisations +to maintain a single password across the organisation. + +Optionally authenticates only if a member of a given group in the directory. + +The person must have registered with Friendika using the normal registration +procedures in order to have a Friendika user record, contact, and profile. + +Note when using with Windows Active Directory: you may need to set TLS_CACERT in your site +ldap.conf file to the signing cert for your LDAP server. + +The required configuration options for this module may be set in the .htconfig.php file +e.g.: + +$a->config['ldapauth']['ldap_server'] = 'host.example.com'; +...etc. diff --git a/addon/ldapauth/ldapauth.php b/addon/ldapauth/ldapauth.php index 2ec30caad7..7230302e9d 100644 --- a/addon/ldapauth/ldapauth.php +++ b/addon/ldapauth/ldapauth.php @@ -1,5 +1,11 @@ + */ + /** * Friendika addon * diff --git a/addon/oembed/oembed.php b/addon/oembed/oembed.php index a0a0239aaf..f5be44194c 100644 --- a/addon/oembed/oembed.php +++ b/addon/oembed/oembed.php @@ -1,10 +1,9 @@ */ require_once('include/oembed.php'); diff --git a/addon/piwik/piwik.php b/addon/piwik/piwik.php index 52bdaeb0d1..032f84f4bb 100644 --- a/addon/piwik/piwik.php +++ b/addon/piwik/piwik.php @@ -1,4 +1,11 @@ + */ + /* Piwik Analytics Plugin for Friendika * diff --git a/addon/poormancron/poormancron.php b/addon/poormancron/poormancron.php index 830c10ddfe..9a8dc1e33f 100644 --- a/addon/poormancron/poormancron.php +++ b/addon/poormancron/poormancron.php @@ -1,9 +1,9 @@ */ function poormancron_install() { diff --git a/addon/randplace/randplace.php b/addon/randplace/randplace.php index fa38de3776..bae8e7c690 100644 --- a/addon/randplace/randplace.php +++ b/addon/randplace/randplace.php @@ -1,13 +1,12 @@ + * + * + * * * Addons are registered with the system in the * .htconfig.php file. @@ -178,4 +177,4 @@ function randplace_settings(&$a,&$s) { $s .= '
'; -} \ No newline at end of file +} diff --git a/addon/sniper/sniper.php b/addon/sniper/sniper.php index 8d31e9cd1f..d431a24666 100644 --- a/addon/sniper/sniper.php +++ b/addon/sniper/sniper.php @@ -1,4 +1,10 @@ + */ /** * Demo plugin for adding various types of Flash games to Friendika. @@ -34,4 +40,4 @@ $o .= <<< EOT EOT; return $o; -} \ No newline at end of file +} diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 39df7d9620..e24ebc1ee0 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -1,5 +1,10 @@ + */ + /* StatusNet Plugin for Friendika * * Author: Tobias Diekershoff diff --git a/addon/tictac/tictac.php b/addon/tictac/tictac.php index a69cda132b..d6cec08a06 100644 --- a/addon/tictac/tictac.php +++ b/addon/tictac/tictac.php @@ -1,4 +1,10 @@ + */ function tictac_install() { diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php index c59d1b9e5c..fef6583f6b 100644 --- a/addon/twitter/twitter.php +++ b/addon/twitter/twitter.php @@ -1,4 +1,10 @@ + */ + /* Twitter Plugin for Friendika * diff --git a/addon/widgets/widgets.php b/addon/widgets/widgets.php index af17d9e9af..f5f8682223 100644 --- a/addon/widgets/widgets.php +++ b/addon/widgets/widgets.php @@ -1,10 +1,11 @@ + */ + function widgets_install() { register_hook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings'); diff --git a/boot.php b/boot.php index 49247eb23f..1c4fc63000 100644 --- a/boot.php +++ b/boot.php @@ -453,6 +453,37 @@ function system_unavailable() { killme(); }} + +// install and uninstall plugin +if (! function_exists('uninstall_plugin')){ +function uninstall_plugin($plugin){ + logger("Addons: uninstalling " . $plugin); + q("DELETE FROM `addon` WHERE `name` = '%s' LIMIT 1", + dbesc($plugin) + ); + + @include_once('addon/' . $plugin . '/' . $plugin . '.php'); + if(function_exists($plugin . '_uninstall')) { + $func = $plugin . '_uninstall'; + $func(); + } +}} + +if (! function_exists('install_plugin')){ +function install_plugin($plugin){ + logger("Addons: installing " . $plugin); + $t = filemtime('addon/' . $plugin . '/' . $plugin . '.php'); + @include_once('addon/' . $plugin . '/' . $plugin . '.php'); + if(function_exists($plugin . '_install')) { + $func = $plugin . '_install'; + $func(); + $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`) VALUES ( '%s', 1, %d ) ", + dbesc($plugin), + intval($t) + ); + } +}} + // Primarily involved with database upgrade, but also sets the // base url for use in cmdline programs which don't have // $_SERVER variables, and synchronising the state of installed plugins. @@ -538,16 +569,7 @@ function check_config(&$a) { if(count($installed)) { foreach($installed as $i) { if(! in_array($i['name'],$plugins_arr)) { - logger("Addons: uninstalling " . $i['name']); - q("DELETE FROM `addon` WHERE `id` = %d LIMIT 1", - intval($i['id']) - ); - - @include_once('addon/' . $i['name'] . '/' . $i['name'] . '.php'); - if(function_exists($i['name'] . '_uninstall')) { - $func = $i['name'] . '_uninstall'; - $func(); - } + uninstall_plugin($i['name']); } else $installed_arr[] = $i['name']; @@ -557,17 +579,7 @@ function check_config(&$a) { if(count($plugins_arr)) { foreach($plugins_arr as $p) { if(! in_array($p,$installed_arr)) { - logger("Addons: installing " . $p); - $t = filemtime('addon/' . $p . '/' . $p . '.php'); - @include_once('addon/' . $p . '/' . $p . '.php'); - if(function_exists($p . '_install')) { - $func = $p . '_install'; - $func(); - $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`) VALUES ( '%s', 1, %d ) ", - dbesc($p), - intval($t) - ); - } + install_plugin($p); } } } @@ -2767,7 +2779,7 @@ function unamp($s) { if(! function_exists('lang_selector')) { function lang_selector() { global $lang; - $o .= '
'; + $o = '
'; $o .= ' + + + +

$logname

+ + + diff --git a/view/admin_plugins.tpl b/view/admin_plugins.tpl new file mode 100644 index 0000000000..ee0fa67e6f --- /dev/null +++ b/view/admin_plugins.tpl @@ -0,0 +1,13 @@ +
+

$title - $page

+ + +
diff --git a/view/admin_plugins_details.tpl b/view/admin_plugins_details.tpl new file mode 100644 index 0000000000..e2c611b236 --- /dev/null +++ b/view/admin_plugins_details.tpl @@ -0,0 +1,21 @@ +
+

$title - $page

+ +

$info.name - $info.version : $action

+

$info.description

+ +

+ {{ for $info.author as $a }} + {{ if $a.link }}$a.name{{ else }}$a.name{{ endif }}, + {{ endfor }} +

+ + + + {{ if $readme }} +

Readme

+
+ $readme +
+ {{ endif }} +
diff --git a/view/admin_site.tpl b/view/admin_site.tpl new file mode 100644 index 0000000000..dba29f11cb --- /dev/null +++ b/view/admin_site.tpl @@ -0,0 +1,48 @@ +
+

$title - $page

+ +
+ + {{ inc field_input.tpl with $field=$sitename }}{{ endinc }} + {{ inc field_textarea.tpl with $field=$banner }}{{ endinc }} + {{ inc field_select.tpl with $field=$language }}{{ endinc }} + {{ inc field_select.tpl with $field=$theme }}{{ endinc }} + +
+ +

Registration

+ {{ inc field_input.tpl with $field=$register_text }}{{ endinc }} + {{ inc field_select.tpl with $field=$register_policy }}{{ endinc }} + + {{ inc field_checkbox.tpl with $field=$no_multi_reg }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$no_openid }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$no_gravatar }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$no_regfullname }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$no_utf }}{{ endinc }} + +
+ +

Upload

+ {{ inc field_input.tpl with $field=$maximagesize }}{{ endinc }} + +

Corporate/Edu

+ {{ inc field_input.tpl with $field=$allowed_sites }}{{ endinc }} + {{ inc field_input.tpl with $field=$allowed_email }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$block_public }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$force_publish }}{{ endinc }} + {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }} + {{ inc field_input.tpl with $field=$global_search_url }}{{ endinc }} + +
+ +

Advanced

+ {{ inc field_checkbox.tpl with $field=$rino_enc }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$verifyssl }}{{ endinc }} + {{ inc field_input.tpl with $field=$proxy }}{{ endinc }} + {{ inc field_input.tpl with $field=$proxyuser }}{{ endinc }} + {{ inc field_input.tpl with $field=$timeout }}{{ endinc }} + +
+ +
+
diff --git a/view/admin_summary.tpl b/view/admin_summary.tpl new file mode 100644 index 0000000000..59428986a1 --- /dev/null +++ b/view/admin_summary.tpl @@ -0,0 +1,36 @@ +
+

$title - $page

+ +
+
$pending.0
+
$pending.1 +
+ +
+
$users.0
+
$users.1
+
+ {{ for $accounts as $p }} +
+
$p.0
+
$p.1
+
+ {{ endfor }} + + +
+
$plugins.0
+ + {{ for $plugins.1 as $p }} +
$p
+ {{ endfor }} + +
+ +
+
$version.0
+
$version.1 - $build +
+ + +
diff --git a/view/admin_users.tpl b/view/admin_users.tpl new file mode 100644 index 0000000000..952a8992b5 --- /dev/null +++ b/view/admin_users.tpl @@ -0,0 +1,88 @@ + +
+

$title - $page

+ +
+ +

$h_pending

+ {{ if $pending }} + + + + {{ for $th_pending as $th }}{{ endfor }} + + + + + + {{ for $pending as $u }} + + + + + + + + {{ endfor }} + +
$th
$u.created$u.name + + +
+ +
+ {{ else }} +

$no_pending

+ {{ endif }} + + + + +

$h_users

+ {{ if $users }} + + + + + {{ for $th_users as $th }}{{ endfor }} + + + + + + {{ for $users as $u }} + + + + + + + + + + + + {{ endfor }} + +
$th
$u.nickname$u.name$u.register_date$u.lastitem_date + + +
+ +
+ {{ else }} + NO USERS?!? + {{ endif }} +
+
diff --git a/view/field.tpl b/view/field.tpl new file mode 100644 index 0000000000..35f5afd39c --- /dev/null +++ b/view/field.tpl @@ -0,0 +1,4 @@ + + {{ if $field.0==select }} + {{ inc field_select.tpl }}{{ endinc }} + {{ endif }} diff --git a/view/field_checkbox.tpl b/view/field_checkbox.tpl new file mode 100644 index 0000000000..4a86da7eaf --- /dev/null +++ b/view/field_checkbox.tpl @@ -0,0 +1,6 @@ + +
+ + + $field.3 +
diff --git a/view/field_input.tpl b/view/field_input.tpl new file mode 100644 index 0000000000..748d93f3ee --- /dev/null +++ b/view/field_input.tpl @@ -0,0 +1,6 @@ + +
+ + + $field.3 +
diff --git a/view/field_select.tpl b/view/field_select.tpl new file mode 100644 index 0000000000..d79eb48e0d --- /dev/null +++ b/view/field_select.tpl @@ -0,0 +1,8 @@ + +
+ + + $field.3 +
diff --git a/view/field_textarea.tpl b/view/field_textarea.tpl new file mode 100644 index 0000000000..2425cdd3b7 --- /dev/null +++ b/view/field_textarea.tpl @@ -0,0 +1,6 @@ + +
+ + + $field.3 +
diff --git a/view/it/strings.php b/view/it/strings.php index 75459e23a0..32092a3f19 100644 --- a/view/it/strings.php +++ b/view/it/strings.php @@ -123,7 +123,7 @@ $a->strings["Administrator"] = "Amministratore"; $a->strings["Friend/Connection Request"] = "Richieste di Amicizia/Connessione"; $a->strings["Examples: jojo@demo.friendika.com, http://demo.friendika.com/profile/jojo, testuser@identi.ca"] = "Esempi: jojo@demo.friendika.com, http://demo.friendika.com/profile/jojo, testuser@identi.ca"; $a->strings["Please answer the following:"] = "Rispondi al seguente:"; -$a->strings["Does \$name know you?"] = "$name ti conosce?"; +$a->strings["Does \$name know you?"] = "\$name ti conosce?"; $a->strings["Yes"] = "Si"; $a->strings["No"] = "No"; $a->strings["Add a personal note:"] = "Aggiungi una nota personale:"; diff --git a/view/nav.tpl b/view/nav.tpl index 7e76811d9e..79114749ad 100644 --- a/view/nav.tpl +++ b/view/nav.tpl @@ -16,6 +16,8 @@ $langselector $nav.search.1 $nav.directory.1 +{{ if $nav.admin }}$nav.admin.1{{ endif }} + {{ if $nav.network }} $nav.network.1 diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 3bf78346f1..2c3700c436 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2530,7 +2530,88 @@ a.mail-list-link { filter:alpha(opacity=100); } +/** + * ADMIN + */ +#pending-update { + float:right; + color: #ffffff; + font-weight: bold; + background-color: #FF0000; + padding: 0em 0.3em; + +} +#adminpage dl { + clear: left; + margin-bottom: 2px; + padding-bottom: 2px; + border-bottom: 1px solid black; +} +#adminpage dt { + width: 200px; + float: left; + font-weight: bold; +} +#adminpage dd { + margin-left: 200px; +} +#adminpage .field { + clear: left; + margin-bottom: 5px; + padding-bottom: 5px; +} + +#adminpage .field label { + float: left; + width: 200px; + font-weight: bold; +} + +#adminpage .field input, +#adminpage .field textarea { + width: 400px; +} +#adminpage .field textarea { height: 100px; } +#adminpage .field_help { + display: block; + margin-left: 200px; + color: #666666; + +} + +#adminpage h3 { + border-bottom: 1px solid #cccccc; +} + +#adminpage .submit { + clear:left; + text-align: right; +} + +#adminpage #pluginslist { + margin: 0px; padding: 0px; +} +#adminpage .plugin { + list-style: none; + display: block; + border: 1px solid #888888; + padding: 1em; + margin-bottom: 5px; + clear: left; +} +#adminpage .plugin .desc { margin-left: 2.5em;} +#adminpage .toggleplugin { + float:left; + margin-right: 1em; +} + +#adminpage table {width:100%; border-bottom: 1p solid #000000; margin: 5px 0px;} +#adminpage table th { text-align: left;} +#adminpage td .icon { float: left;} +#adminpage table#users img { width: 16px; height: 16px; } +#adminpage table tr:hover { background-color: #bbc7d7; } +#adminpage .selectall { text-align: right; } /** * ICONS */ @@ -2569,7 +2650,11 @@ a.mail-list-link { .language { background-position: -96px -32px; } .prev { background-position: -112px -32px; } .next { background-position: -128px -32px; } +.on { background-position: -144px -32px; } +.off { background-position: 0px -48px; } + +.icon.dim { opacity: 0.3;filter:alpha(opacity=30); } .attachtype { display: block; width: 20px; height: 23px; diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index c07ef045a4..9ab3bb6bcc 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -2552,6 +2552,79 @@ a.mail-list-link { top: 0px; } +/** + * ADMIN + */ + +#adminpage dl { + clear: left; + margin-bottom: 2px; + padding-bottom: 2px; + border-bottom: 1px solid black; +} +#adminpage dt { + width: 200px; + float: left; + font-weight: bold; +} +#adminpage dd { + margin-left: 200px; +} + +#adminpage .field { + clear: left; + margin-bottom: 5px; + padding-bottom: 5px; +} + +#adminpage .field label { + float: left; + width: 200px; + font-weight: bold; +} + +#adminpage .field input, +#adminpage .field textarea { + width: 400px; +} +#adminpage .field textarea { height: 100px; } +#adminpage .field_help { + display: block; + margin-left: 200px; + color: #666666; + +} + +#adminpage h3 { + border-bottom: 1px solid #cccccc; +} + +#adminpage .submit { + clear:left; +} + +#adminpage #pluginslist { + margin: 0px; padding: 0px; +} +#adminpage .plugin { + list-style: none; + display: block; + border: 1px solid #888888; + padding: 1em; + margin-bottom: 5px; + clear: left; +} +#adminpage .plugin .toggle { + float:left; + margin-right: 1em; +} + +#adminpage table {width:100%; border-bottom: 1p solid #000000; margin: 5px 0px;} +#adminpage table th { text-align: left;} +#adminpage td .icon { float: left;} +#adminpage table#users img { width: 16px; height: 16px; } +#adminpage table tr:hover { background-color: #bbc7d7; } +#adminpage .selectall { text-align: right; } /** * ICONS */ @@ -2590,6 +2663,11 @@ a.mail-list-link { .language { background-position: -96px -32px; } .prev { background-position: -112px -32px; } .next { background-position: -128px -32px; } +.on { background-position: -144px -32px; } + +.off { background-position: 0px -48px; } + +.icon.dim { opacity: 0.3;filter:alpha(opacity=30); } .attachtype { display: block; width: 20px; height: 23px;