Commit 1179ed9e authored by sylvieg's avatar sylvieg

[MRG] Automatic merge, branches/6.x 29683 to 29781

parent 165c1d2e
......@@ -1391,6 +1391,7 @@ installer/schema/20100923_fix_column_position_tiki.sql -text
installer/schema/20100923_social_networking_permission_and_menuitem_tiki.sql -text
installer/schema/20100925_fix_some_default_value_tiki.sql -text
installer/schema/20100927_better_column_fix_tiki.php -text
installer/schema/20100928_sefurl_regex_reordering_tiki.sql -text
installer/schema/99999999_image_plugins_kill_tiki.php -text
installer/schema/index.php -text
installer/shell.php -text
......@@ -2297,6 +2298,7 @@ lib/prefs/blogues.php -text
lib/prefs/bot.php -text
lib/prefs/box.php -text
lib/prefs/calendar.php -text
lib/prefs/captcha.php -text
lib/prefs/cas.php -text
lib/prefs/categories.php -text
lib/prefs/category.php -text
......@@ -2906,9 +2908,9 @@ lib/validators/validator_password.php -text
lib/validators/validator_regex.php -text
lib/validators/validator_username.php -text
lib/validatorslib.php -text
lib/videogals/KalturaClientBase_v3.php -text
lib/videogals/KalturaClient.php -text
lib/videogals/KalturaClientBase.php -text
lib/videogals/KalturaClientReadme.txt -text
lib/videogals/KalturaClient_v3.php -text
lib/videogals/videogallib.php -text
lib/videogals/watershedlib.php -text
lib/web.config -text
......@@ -4466,7 +4468,6 @@ templates/tiki-browse_categories.tpl -text
templates/tiki-browse_freetags.tpl -text
templates/tiki-browse_gallery.tpl -text
templates/tiki-browse_image.tpl -text
templates/tiki-browse_video.tpl -text
templates/tiki-calendar.tpl -text
templates/tiki-calendar_box.tpl -text
templates/tiki-calendar_box_multiple.tpl -text
......@@ -4520,7 +4521,6 @@ templates/tiki-edit_submission.tpl -text
templates/tiki-edit_templates.tpl -text
templates/tiki-edit_topic.tpl -text
templates/tiki-edit_translation.tpl -text
templates/tiki-edit_video.tpl -text
templates/tiki-editpage.tpl -text
templates/tiki-export-sheets.tpl -text
templates/tiki-export_comment_xml.tpl -text
......
......@@ -40,6 +40,11 @@ FileETag none
<IfModule mod_rewrite.c>
RewriteEngine On
# If your Tiki is not at the root of the server (e.g. at http://example.com/tiki)
# You will need to uncomment and fix the RewriteBase value below to suit your installation.
# RewriteBase "/tiki"
#If your website is a checkout
RewriteRule ^\.svn/ - [F,L]
......@@ -99,6 +104,7 @@ RewriteRule ^wml$ tiki-mobile.php [L]
RewriteRule ^sheets$ tiki-sheets.php [L]
# access any object by its numeric identifier
RewriteRule ^article([0-9]+)\-.*(&comzone=.*)$ article$1$2
RewriteRule ^article([0-9]+)\-.*$ article$1
RewriteRule ^blog([0-9]+)\-.*$ blog$1
RewriteRule ^blogpost([0-9]+)\-.*$ blogpost$1
......
......@@ -43,20 +43,14 @@ if ( isset($forum_mode) && $forum_mode == 'y' ) {
foreach ( $handled_requests as $request_name )
if ( isset($_SESSION['forums_'.$request_name]) && ! isset($_REQUEST[$request_name]) )
$$request_name = $_SESSION['forums_'.$request_name];
if (empty($thread_sort_mode)) {
$thread_sort_mode = $prefs['forum_thread_sort_mode'];
}
} else {
// Fallback to global values if 'forum_thread_user_settings_keep' is disabled AND if :
// - forum specific settings are set to empty (i.e. 'default')
// or - 'forum_thread_defaults_by_forum' is disabled (don't allow settings by forum)
// !! Global value is not used when there is an explicit user request !!
foreach ( $handled_requests as $request_name )
if ( ( ! isset($$request_name) || $$request_name == '' || $prefs['forum_thread_defaults_by_forum'] != 'y' )
&& ! isset($_REQUEST[$request_name])
) $$request_name = $prefs['forum_'.$request_name];
}
foreach ( $handled_requests as $request_name ) {
if ( empty($$request_name) && empty($_REQUEST[$request_name]) ) {
$$request_name = $prefs['forum_'.$request_name];
} elseif ( empty($$request_name) && !empty($_REQUEST[$request_name]) ) {
$$request_name = $_REQUEST[$request_name];
}
}
if ( $forum_info['is_flat'] == 'y' ) {
// If we have a flat forum (i.e. we reply only to the first message / thread)
......
......@@ -11,3 +11,7 @@
.daterow:active {
border: 1px inset #ddd;
}
.calendar {
z-index: 6;
}
......@@ -3410,7 +3410,7 @@ INSERT INTO `tiki_sefurl_regex_out` (`left`, `right`, `type`, `feature`) VALUES(
INSERT INTO `tiki_sefurl_regex_out` (`left`, `right`, `type`, `feature`) VALUES('tiki-browse_image.php\\?imageId=(\\d+)', 'browseimage$1', 'image', 'feature_galleries');
INSERT INTO `tiki_sefurl_regex_out` (`left`, `right`, `type`, `feature`) VALUES('tiki-directory_browse.php\\?parent=(\\d+)', 'directory$1', 'directory', 'feature_directory');
INSERT INTO `tiki_sefurl_regex_out` (`left`, `right`, `type`, `feature`) VALUES('tiki-view_faq.php\\?faqId=(\\d+)', 'faq$1', 'faq', 'feature_faqs');
INSERT INTO `tiki_sefurl_regex_out` (`left`, `right`, `type`, `feature`) VALUES('tiki-download_file.php\\?fileId=(\\d+)', 'dl$1', 'file', 'feature_file_galleries');
INSERT INTO `tiki_sefurl_regex_out` (`left`, `right`, `type`, `feature`, `order`) VALUES('tiki-download_file.php\\?fileId=(\\d+)', 'dl$1', 'file', 'feature_file_galleries', 10);
INSERT INTO `tiki_sefurl_regex_out` (`left`, `right`, `type`, `feature`) VALUES('tiki-download_file.php\\?fileId=(\\d+)&amp;thumbnail', 'thumbnail$1', 'thumbnail', 'feature_file_galleries');
INSERT INTO `tiki_sefurl_regex_out` (`left`, `right`, `type`, `feature`) VALUES('tiki-download_file.php\\?fileId=(\\d+)&amp;display', 'display$1', 'display', 'feature_file_galleries');
INSERT INTO `tiki_sefurl_regex_out` (`left`, `right`, `type`, `feature`) VALUES('tiki-download_file.php\\?fileId=(\\d+)&amp;preview', 'preview$1', 'preview', 'feature_file_galleries');
......
......@@ -921,6 +921,7 @@ function display_howto() {
- update list of valid releases in getVersions()
- Make sure you add all Tiki versions (not just the one you are doing now). Ex.: when 5.0 is released, 4.2 will probably exist, and this was added to branches/4.x but not merged by script.
- change the version branch to "unstable", "stable", or "head" as explained in that file
- Delete tiki-secdb_x.y_mysql.sql files from previous versions
- Commit your changes with this commit message (change \$VERSION by the version of the release):
[REL] Preparing \$VERSION release
......
......@@ -19,7 +19,6 @@ function upgrade_20100507_flash_banner_tiki( $installer ) {
$movie['width'] = $matches[4];
$movie['height'] = $matches[5];
$movie['version'] = $matches[6];
echo 'eeee';
$installer->query( $query, array(serialize($movie), $res['bannerId']));
}
}
......
UPDATE `tiki_sefurl_regex_out` SET `order` = '10' WHERE `tiki_sefurl_regex_out`.`left` = 'tiki-download_file.php\\?fileId=(\\d+)';
......@@ -37,7 +37,7 @@ if (empty($_REQUEST['install_step'])) {
if (isset($_REQUEST['setdbversion'])) {
// Sets dbversion_tiki when installing the WebDeploy package
$db = fopen('db/local.php', 'a');
$db = fopen('db/'.$tikidomainslash.'local.php', 'a');
require_once 'lib/setup/twversion.class.php';
$TWV = new TWVersion();
fwrite($db, "\n\$dbversion_tiki='" . $TWV->getBaseVersion() . "';\n");
......@@ -759,7 +759,7 @@ if (!isset($install_type)) {
if ( isset( $_GET['lockenter'] ) || isset( $_GET['nolockenter'] ) ) {
if (isset( $_GET['lockenter'])) {
touch( 'db/lock' );
touch( 'db/'.$tikidomainslash.'lock' );
}
global $userlib, $cachelib;
......
......@@ -8853,6 +8853,7 @@ $lang=Array(
"New Reply" => "Nouvelle réponse",
"Editing reply" => "Modifier la réponse",
"Reply to the selected post" => "Répondre au message sélectionné",
"Reply to the selected commwent" => "Répondre au commentaire sélectionné",
"Post new message" => "Publier un nouveau message",
"Editing comment" => "Modifier le commentaire sélectionné",
"Comment on the selected post" => "Répondre au commentaire sélectionné",
......
......@@ -55,6 +55,11 @@ class TikiLdapLib
protected $logslib=NULL;
/**
* @var array The user attributes
*/
protected $user_attributes = null;
// Constructor
public function __construct($options) {
......@@ -153,11 +158,21 @@ class TikiLdapLib
}
// Do a ldap bind
public function bind() {
public function bind( $reconnect = false ) {
global $prefs;
if($this->ldaplink instanceof Net_LDAP2) {
return (true); // do not try to reconnect since this may lead to huge timeouts
// Force the reconnection
if ($this->ldaplink instanceof Net_LDAP2) {
if ($reconnect === true) {
$this->ldaplink->disconnect();
} else {
return (true); // do not try to reconnect since this may lead to huge timeouts
}
}
// Set the bindnpw with the options['password']
$this->options['bindpw'] = $this->options['password'];
$user=$this->options['username'];
switch ($this->options['bind_type']) {
case 'ad': // active directory
......@@ -182,20 +197,16 @@ class TikiLdapLib
case 'ol': // openldap
$this->options['binddn'] = 'cn='.$user.','.$prefs['auth_ldap_basedn'];
break;
case 'default':
// Anonymous binding
$this->options['binddn'] = '';
$this->options['bindpw'] = '';
break;
default:
// Anonymous binding
$options_anonymous = $this->options;
$options_anonymous['binddn'] = '';
$options_anonymous['bindpw'] = '';
$this->ldaplink= Net_LDAP2::connect($options_anonymous);
if(Net_LDAP2::isError($this->ldaplink)) {
$this->add_log('ldap','Error: '.$this->ldaplink->getMessage().' at line '.__LINE__.' in '.__FILE__);
}
self::get_user_attributes();
$this->options['binddn'] = $this->user_attributes['dn'];
$this->ldaplink->disconnect();
$this->add_log('ldap','Error: Invalid "bind_type" value "'.$this->options['bind_type'].'".');
die;
}
// attributes to fetch
/*
$options['attributes'] = array();
......@@ -390,4 +401,39 @@ class TikiLdapLib
$this->logslib->add_log($facility,$message);
}
/**
* Setter to set an otpion value
* @param string $name The name of the option
* @param mixed $value The value
* @return void
* @throw Exception
*/
public function setOption ($name, $value = null) {
try {
if (isset($this->options[$name])) {
$this->options[$name] = $value;
} else {
throw new Exception(sprintf("Undefined option: %s \n", $name), E_USER_WARNING);
}
} catch (Exception $e) { }
}
/**
* Return the value of the attribue past in param
* @param string $name The name of the attribute
* @return mixed
* @throw Exception
*/
public function getUserAttribute ($name) {
$value = '';
try {
$values = self::get_user_attributes();
if (isset($values[$name])) {
$value = $values[$name];
} else {
throw new Exception(sprintf("Undefined attribute %s \n", $name), E_USER_WARNING);
}
} catch (Exception $e) {}
return $value;
}
}
......@@ -39,7 +39,7 @@ class Captcha
*
* @return null
*/
function __construct($wordLen = 6, $width = 180) {
function __construct() {
global $prefs;
if ($prefs['recaptcha_enabled'] == 'y' && !empty($prefs['recaptcha_privkey']) && !empty($prefs['recaptcha_pubkey'])) {
......@@ -55,12 +55,13 @@ class Captcha
$this->recaptchaCustomTranslations();
} else if (extension_loaded('gd') && function_exists('imagepng') && function_exists('imageftbbox')) {
$this->captcha = new Zend_Captcha_Image(array(
'wordLen' => $wordLen,
'wordLen' => $prefs['captcha_wordLen'],
'timeout' => 600,
'font' => dirname(__FILE__) . '/DejaVuSansMono.ttf',
'imgdir' => 'temp/public/',
'suffix' => '.captcha.png',
'width' => $width,
'width' => $prefs['captcha_width'],
'dotNoiseLevel' => $prefs['captcha_noise'],
));
$this->type = 'default';
} else {
......
......@@ -104,13 +104,13 @@
}
});
}
if (true) { // sure there should be a test here
if (jqueryTiki.autosave) { // pref check
this.ckToHtml = editor.dataProcessor.toHtml; // reference to original ckeditor dataProcessor
this.ckToData = editor.dataProcessor.toDataFormat;
editor.dataProcessor.toDataFormat = function ( html, fixForBody ) { return asplugin.toHTMLSource( editor, html, fixForBody ); };
editor.dataProcessor.toHtml = function ( data, fixForBody ) { return asplugin.toHtmlFormat( editor, data, fixForBody ); };
}
}
}, // end of init()
toHTMLSource: function( editor, html, fixForBody ) {
......@@ -135,6 +135,9 @@
},
toHtmlFormat: function( editor, data, fixForBody ) {
if (!jqueryTiki.autosave) {
alert(tr("AJAX Autosave preference not enabled. Please go to admin/features/interface to enable it."));
}
var output = "";
var asplugin = this;
var orig_data = $("#editwiki").val(); // just in case
......
......@@ -1576,6 +1576,17 @@ class FileGalLib extends TikiLib
function getWikiSyntax($galleryId=0) {
global $prefs;
if (isset($_REQUEST['filegals_manager'])) { // for use in plugin edit popup
if ($_REQUEST['filegals_manager'] === 'fgal_picker_id') {
return '%fileId%'; // for use in plugin edit popup
} else if ($_REQUEST['filegals_manager'] === 'fgal_picker') {
$href = 'tiki-download_file.php?fileId=123&amp;display'; // dummy id as sefurl expects a (/d+) pattern
global $smarty; include_once('tiki-sefurl.php');
$href = filter_out_sefurl($href, $smarty);
return str_replace('123', '%fileId%', $href);
}
}
$syntax = $this->getOne('SELECT `wiki_syntax` FROM `tiki_file_galleries` WHERE `galleryId`=?', array($galleryId));
if (!empty($syntax)) {
return $syntax;
......
<?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki/CMS/Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: recaptcha.php 28075 2010-07-20 11:41:48Z jonnybradley $
function prefs_captcha_list() {
return array (
'captcha_wordLen' => array(
'name' => tra('Word length of the captcha image'),
'type' => 'text',
'description' => tra('Word length of the captcha image.').' '.tra('Default:'). '6',
'default' => '6',
),
'captcha_width' => array(
'name' => tra('Width of the captcha image in pixels'),
'type' => 'text',
'description' => tra('Width of the captcha image in pixels.').' '.tra('Default:'). '180',
'default' => '180',
),
'captcha_noise' => array(
'name' => tra('Level of noise of the captcha image'),
'type' => 'text',
'description' => tra('Level of noise of the captcha image.').' '.tra('Choose a smaller number for less noise and easier reading.').' '.tra('Default:'). '100',
'default' => 100,
),
);
}
......@@ -6,7 +6,7 @@
// $Id$
function prefs_global_list() {
global $tikilib, $prefs;
global $tikilib, $prefs, $url_host;
$all_styles = $tikilib->list_styles();
$styles = array();
......@@ -351,6 +351,19 @@ function prefs_global_list() {
'type' => 'text',
'size' => 20,
),
'kuser' => array(
'name' => tra('Kaltura "User"'),
'description' => tra('Owner of content shared by all Tiki users on this site. If empty then each Tiki user can only see their own media entries.'),
'hint' => tra("You could use your server name for this. e.g. $url_host"),
'type' => 'text',
'size' => 20,
),
'kServiceUrl' => array(
'name' => tra('Kaltura Service URL'),
'description' => tra('e.g. http://www.kaltura.com/'),
'type' => 'text',
'size' => 40,
),
// End Kaltura
);
}
......
......@@ -89,6 +89,8 @@ jqueryTiki.effect_tabs = "'.$prefs['jquery_effect_tabs'].'"; // Different effec
jqueryTiki.effect_tabs_direction = "'.$prefs['jquery_effect_tabs_direction'].'";
jqueryTiki.effect_tabs_speed = '.($prefs['jquery_effect_tabs_speed'] == 'normal' ? '400' : '"'.$prefs['jquery_effect_tabs_speed'].'"').';
jqueryTiki.autosave = '.($prefs['ajax_autosave'] == 'y' ? 'true' : 'false') . ';
'; // NB replace "normal" speeds with int to workaround issue with jQuery 1.4.2
$headerlib->add_js($js, 100);
......
......@@ -27,7 +27,7 @@ function get_default_prefs() {
return $prefs;
}
global $tikidate, $tikilib;
global $tikidate, $tikilib, $url_host;
$prefs = array(
// tiki and version
'tiki_release' => '0',
......@@ -1419,11 +1419,13 @@ function get_default_prefs() {
'partnerId' => '',
'secret' => '',
'adminSecret' => '',
'kdpUIConf' => '48411',
'kdpUIConf' => '1913592',
'kdpWidget' => '',
'kcwUIConf' => '36200',
'kseUIConf' => '36300',
'kcwUIConf' => '1913682',
'kseUIConf' => '2434291',
'kaeUIConf' => '1000865',
'kuser' => $url_host,
'kServiceUrl' => 'http://www.kaltura.com/',
// BigBlueButton
'bigbluebutton_feature' => 'n',
......@@ -1448,6 +1450,10 @@ function get_default_prefs() {
'recaptcha_enabled' => 'n',
'recaptcha_pubkey' => '',
'recaptcha_privkey' => '',
// Captcha
'captcha_wordLen' => 6,
'captcha_width' => 180,
'captcha_noise' => 100,
// unsorted features
'anonCanEdit' => 'n',
......
......@@ -112,6 +112,7 @@ class TWVersion
'3.5',
'3.6',
'3.7',
'3.8',
'4.0beta1',
'4.0RC1',
'4.0',
......@@ -127,6 +128,7 @@ class TWVersion
'5.1RC1',
'5.1',
'5.2',
'5.3',
);
}
......
......@@ -1168,11 +1168,13 @@ browser();
//This was added to allow wiki3d to change url on tiki's window
window.name = 'tiki';
if (typeof fgals_window == "undefined") {
fgals_window = null;
}
function openFgalsWindow(filegal_manager_url, area_id) {
var fgals_window = null;
function openFgalsWindow(filegal_manager_url, reload) {
if(fgals_window && typeof fgals_window.document != "undefined" && typeof fgals_window.document != "unknown" && !fgals_window.closed) {
if (reload) {
fgals_window.location.replace(filegal_manager_url);
}
fgals_window.focus();
} else {
fgals_window=window.open(filegal_manager_url,'_blank','menubar=1,scrollbars=1,resizable=1,height=500,width=800,left=50,top=50');
......@@ -1513,14 +1515,7 @@ function build_plugin_form_row(row, name, label_name, requiredOrSpecial, value,
}
function openFgalsWindowArea(area) {
if (typeof fgals_window == "undefined") {
var fgals_window = null;
}
if(fgals_window && fgals_window.document) {
fgals_window.focus();
} else {
fgals_window=window.open('tiki-list_file_gallery.php?filegals_manager='+area,'_blank','menubar=1,scrollbars=1,resizable=1,height=500,width=800,left=50,top=50');
}
openFgalsWindow('tiki-list_file_gallery.php?filegals_manager='+area, true); // reload
}
......
......@@ -5377,16 +5377,17 @@ class TikiLib extends TikiDb_Bridge
$arg_str = rtrim($arg_str, '&');
$icon = isset($info['icon']) ? $info['icon'] : 'pics/icons/wiki_plugin_edit.png';
// some plugins are just too flakey to do wysiwyg, so return the source for them ;(
if (in_array($name, array())) {
return '~np~' . $ck_editor_plugin . '~/np~';
}
// pre-parse the output so nested plugins don't fall out all over the place
$plugin_result = $this->parse_data($plugin_result, array('is_html' => false, 'suppress_icons' => true, 'ck_editor' => true, 'noparseplugins' => true));
// remove hrefs and onclicks
$plugin_result = preg_replace('/\shref\=/i', ' tiki_href=', $plugin_result);
$plugin_result = preg_replace('/\sonclick\=/i', ' tiki_onclick=', $plugin_result);
$plugin_result = preg_replace('/<script.*?<\/script>/mi', '', $plugin_result);
// some plugins are just too flakey to do wysiwyg, so show the "source" for them ;(
if (in_array($name, array('trackerlist'))) {
$plugin_result = preg_replace('/[\{\}]/m', '', $ck_editor_plugin);
} else {
// pre-parse the output so nested plugins don't fall out all over the place
$plugin_result = $this->parse_data($plugin_result, array('is_html' => false, 'suppress_icons' => true, 'ck_editor' => true, 'noparseplugins' => true));
// remove hrefs and onclicks
$plugin_result = preg_replace('/\shref\=/i', ' tiki_href=', $plugin_result);
$plugin_result = preg_replace('/\sonclick\=/i', ' tiki_onclick=', $plugin_result);
$plugin_result = preg_replace('/<script.*?<\/script>/mi', '', $plugin_result);
}
if ($this->contains_html_block($plugin_result)) {
$elem = 'div';
......
<?php
s<?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki/CMS/Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -94,6 +94,7 @@ abstract class Toolbar
'h1',
'h2',
'h3',
'titlebar',
'toc',
'list',
'numlist',
......@@ -651,6 +652,12 @@ class ToolbarBlock extends ToolbarInline // Will change in the future
$wysiwyg = null;
$syntax = str_repeat('!', $tagName{1}) . 'text';
break;
case 'titlebar':
$label = tra('Title bar');
$icon = 'pics/icons/text_padding_top.png';
$wysiwyg = null;
$syntax = '-=text=-';
break;
case 'toc':
$label = tra('Table of contents');
$icon = tra('pics/icons/book.png');
......@@ -673,8 +680,13 @@ class ToolbarBlock extends ToolbarInline // Will change in the future
function getWikiHtml( $areaId ) // {{{
{
return $this->getSelfLink('insertAt(\'' . $areaId . '\', \'' . addslashes(htmlentities($this->syntax, ENT_COMPAT, 'UTF-8')) . '\', true);',
if ($this->syntax == '...page...') { // for some reason breaks toolbar when inside nested plugins
return $this->getSelfLink('insertAt(\'' . $areaId . '\', \'...\'+\'page\'+\'...\');',
htmlentities($this->label, ENT_QUOTES, 'UTF-8'), 'qt-block');
} else {
return $this->getSelfLink('insertAt(\'' . $areaId . '\', \'' . addslashes(htmlentities($this->syntax, ENT_COMPAT, 'UTF-8')) . '\', true);',
htmlentities($this->label, ENT_QUOTES, 'UTF-8'), 'qt-block');
}
} // }}}
}
......
......@@ -992,17 +992,21 @@ class TrackerLib extends TikiLib
}
}
/* listfields fieldId=>ooptions */
function get_item_fields($trackerId, $itemId, $listfields, &$itemUser) {
function get_item_fields($trackerId, $itemId, $listfields, &$itemUser, $alllang=false) {
global $prefs, $user, $tiki_p_admin_trackers;
$fields = array();
$fil = array();
$kx = '';
$bindvars = array((string)$prefs['language'], (int)$itemId);
$bindvars = array((int)$itemId);
$query2 = 'SELECT ttf.`fieldId`, `value`, `isPublic`'
$query2 = 'SELECT ttf.`fieldId`, `value`, `isPublic`, `lang`, `isMultilingual` '
.' FROM `tiki_tracker_item_fields` ttif INNER JOIN `tiki_tracker_fields` ttf ON ttif.`fieldId` = ttf.`fieldId`'
." WHERE (`lang` = ? or `lang` is null or `lang` = '') AND `itemId` = ?";
." WHERE `itemId` = ?";
if (!$alllang) {
$query2 .= " AND (`lang` = ? or `lang` is null or `lang` = '') ";
$bindvars[] = (string)$prefs['language'];
}
if (!empty($listfields)) {
$query2 .= " AND " . $this->in('ttif.fieldId', array_keys($listfields), $bindvars);
}
......@@ -1010,7 +1014,13 @@ class TrackerLib extends TikiLib
$result2 = $this->fetchAll($query2, $bindvars);
foreach( $result2 as $res1 ) {
$fil[$res1['fieldId']] = $res1['value'];
if ($alllang && $res1['isMultilingual'] == 'y') {
if ($prefs['language'] == $res1['lang'])
$fil[$res1['fieldId']] = $res1['value'];
$sup[$res1['fieldId']]['lingualvalue'][] = array('lang' => $res1['lang'], 'value' => $res1['value']);
} else {
$fil[$res1['fieldId']] = $res1['value'];
}
}
foreach ( $listfields as $fieldId =>$fopt ) { // be possible to need the userItem before this field
......@@ -1025,6 +1035,10 @@ class TrackerLib extends TikiLib
if (isset($fil[$fieldId])) {
$fopt['value'] = $fil[$fieldId];
}
if (isset($sup[$fieldId]['lingualvalue'])) {
$fopt['lingualvalue'] = $sup[$fieldId]['lingualvalue'];
$fopt['isMultilingual'] = 'y';
}
if ($tiki_p_admin_trackers != 'y') {
if ($fopt['isHidden'] == 'y') {
$fopt['value'] = '';
......
......@@ -919,13 +919,25 @@ class UsersLib extends TikiLib
global $prefs;
global $logslib;
// First connection on the ldap server in anonymous, now we can search the real name of the $user
// It's required to pass in param the username & password because the username is used to determine the realname (dn)
$this->init_ldap($user, $pass);
$err = $this->ldap->bind();
if (is_int($err)) {
$err=Net_LDAP2::errorMessage($err);
}
// Change the default bind_type to use the full, call get_user_attributes function to use the realname (dn) in the credentials test
$this->ldap->setOption('bind_type', 'full');
$this->ldap->get_user_attributes();
// Credentials test! To test it we force the reconnection.
$err = $this->ldap->bind(true);
if (is_int($err)) {
$err=Net_LDAP2::errorMessage($err);
}
switch($err) {
case 'LDAP_INVALID_CREDENTIALS':
return PASSWORD_INCORRECT;
......@@ -1780,7 +1792,7 @@ class UsersLib extends TikiLib
if (!is_null($result)) {
$home = $this->get_group_home($result);
if ($home != '')
return $home;
return $this->best_multilingual_page($home);
}
$query = "select g.`groupHome`, g.`groupName` from `users_usergroups` as gu, `users_users` as u, `users_groups`as g where gu.`userId`= u.`userId` and u.`login`=? and gu.`groupName`= g.`groupName` and g.`groupHome` != '' and g.`groupHome` is not null";
$result = $this->query($query,array($user));
......@@ -1796,7 +1808,20 @@ class UsersLib extends TikiLib
$home = $res["groupHome"];
$group = $res["groupName"];
}
return $home;
return $this->best_multilingual_page($home);
}
function best_multilingual_page($page) {
global $prefs;
if ($prefs['feature_multilingual'] != 'y') {
return ($page);
}
$info = $this->get_page_info($page);
global $multilinguallib; include_once ("lib/multilingual/multilinguallib.php");
$bestLangPageId = $multilinguallib->selectLangObj('wiki page', $info['page_id'], $prefs['language']);
if ($info['page_id'] == $bestLangPageId) {
return $page;
}
return $this->get_page_name_from_id($bestLangPageId);
}
function get_user_default_homepage2($user) {
global $prefs;
......
This diff is collapsed.
The two files KalturaClient_v3.php and KalturaClientBase_v3.php are part of the Kaltura Client Library provided by Kaltura (http://kaltura.org), and are distributed as part of Tiki, with permission from Kaltura. The files contain other limitations, including disclaimers of warranty, that apply to any use of the files. You may distribute or use these unchanged as part of Tiki. Any use or distribution of the files separate from the Tiki software, and/or any changes to these files whether part of Tiki or otherwise, shall be subject to the licensing terms set forth by the copyright holders.
The two files KalturaClient.php and KalturaClientBase.php are part of the Kaltura Client Library provided by Kaltura (http://kaltura.org), and are distributed as part of Tiki, with permission from Kaltura. The files contain other limitations, including disclaimers of warranty, that apply to any use of the files. You may distribute or use these unchanged as part of Tiki. Any use or distribution of the files separate from the Tiki software, and/or any changes to these files whether part of Tiki or otherwise, shall be subject to the licensing terms set forth by the copyright holders.
This diff is collapsed.
......@@ -11,27 +11,43 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
exit;
}
$secret = $prefs['secret'];
$partner_id = $prefs['partnerId'];
$subp_id = (int)$prefs['partnerId']*100;
$admin_secret = $prefs['adminSecret'];
$service_url = "http://www.kaltura.com";
require_once ( "KalturaClient_v3.php");
$mediaType = array("Any","Video","Image","Text","HTML","Audio","Video Remix","SHOW_XML","","Bubbles","XML","Document");
function kaltura_init_config ()
{
global $partner_id,$subp_id ,$secret ,$admin_secret , $service_url ;
$conf = new KalturaConfiguration( $partner_id , $subp_id );
$conf->partnerId = $partner_id;
$conf->subPartnerId = $subp_id;
$conf->secret = $secret;
$conf->adminSecret = $admin_secret;
$conf->serviceUrl = "http://www.kaltura.com";
return $conf;
require_once ('lib/videogals/KalturaClient.php');