diff --git a/main/cron/lang/langstats_file_builder.php b/main/cron/lang/langstats_file_builder.php
index fb6f70fcfd..5870eeb2ae 100755
--- a/main/cron/lang/langstats_file_builder.php
+++ b/main/cron/lang/langstats_file_builder.php
@@ -1,5 +1,6 @@
10000) { break; }
- $words = str_word_count(get_lang($row['term_name'], null, $orig_lang));
- $words_counter += $words;
- $terms_in_limit[$row['term_name']] = $i;
- //echo "Term ".$row['term_name']." is '".get_lang($row['term_name'],null,$orig_lang)."' which means $words words
\n";
- //if ($words_counter%1000 >= 0) {
+ if ($words_counter > 10000) {
+ break;
+ }
+ $words = str_word_count(get_lang($row['term_name'], null, $orig_lang));
+ $words_counter += $words;
+ $terms_in_limit[$row['term_name']] = $i;
+ //echo "Term ".$row['term_name']." is '".get_lang($row['term_name'],null,$orig_lang)."' which means $words words
\n";
+ //if ($words_counter%1000 >= 0) {
//echo "Reached $words_counter words at term $i (".$row['term_name']." used ".$row['term_count']." times)...
\n";
- //}
- $i++;
+ //}
+ $i++;
}
//echo $words_counter.'
';
@@ -49,8 +50,8 @@ echo "Reached ".count($terms_in_limit)." terms for the $words_counter most-used
echo "Scanning English files, trying to find these terms...
\n";
if (!is_dir($arch_dir.'/langstats')) {
- mkdir($arch_dir.'/langstats');
- mkdir($arch_dir.'/langstats/'.$orig_lang);
+ mkdir($arch_dir.'/langstats');
+ mkdir($arch_dir.'/langstats/'.$orig_lang);
}
$list_files = scandir($lang_dir.'/'.$orig_lang);
$j = 1;
@@ -59,38 +60,42 @@ $words_found = 0;
$global_var = array(); //keep the combination of all vars
$terms_in_limit = array_flip($terms_in_limit);
foreach ($list_files as $file) {
- if (substr($file, 0, 1) == '.') {continue; }
- //echo "'".substr($file,0,-8)."',
"; //print in a PHP array format
- $vars = file($lang_dir.'/'.$orig_lang.'/'.$file);
- $local_var = array();
- $file_string = ' 0) {
- //echo $var[1]."
";
-
- if (in_array(substr($var[1], 1), $terms_in_limit)) {
- //echo "Var ".$var[1]." was in the limit
";
- $local_var[$var[1]] = $line;
- $file_string .= $line;
- $terms_found[] = substr($var[1], 1); //e.g. store Tools
- $words_found += str_word_count(get_lang($var[1], null, $orig_lang));
- } elseif (in_array(substr($var[1], 5), $terms_in_limit)) {
- //echo "Var ".$var[1]." was in the limit
";
- $local_var[$var[1]] = $line;
- $file_string .= $line;
- $terms_found[] = substr($var[1], 5); //e.g. store langTools
- $words_found += str_word_count(get_lang(substr($var[1], 5), null, $orig_lang));
- } //else do not care
+ if (substr($file, 0, 1) == '.') {
+ continue;
+ }
+ //echo "'".substr($file,0,-8)."',
"; //print in a PHP array format
+ $vars = file($lang_dir.'/'.$orig_lang.'/'.$file);
+ $local_var = array();
+ $file_string = ' 0) {
+ //echo $var[1]."
";
+
+ if (in_array(substr($var[1], 1), $terms_in_limit)) {
+ //echo "Var ".$var[1]." was in the limit
";
+ $local_var[$var[1]] = $line;
+ $file_string .= $line;
+ $terms_found[] = substr($var[1], 1); //e.g. store Tools
+ $words_found += str_word_count(get_lang($var[1], null, $orig_lang));
+ } elseif (in_array(substr($var[1], 5), $terms_in_limit)) {
+ //echo "Var ".$var[1]." was in the limit
";
+ $local_var[$var[1]] = $line;
+ $file_string .= $line;
+ $terms_found[] = substr($var[1], 5); //e.g. store langTools
+ $words_found += str_word_count(get_lang(substr($var[1], 5), null, $orig_lang));
+ } //else do not care
+ }
}
- }
- echo "Writing ".$arch_dir.'/langstats/'.$orig_lang.'/'.$file."
\n";
- file_put_contents($arch_dir.'/langstats/'.$orig_lang.'/'.$file, $file_string);
- $global_var += $local_var;
+ echo "Writing ".$arch_dir.'/langstats/'.$orig_lang.'/'.$file."
\n";
+ file_put_contents($arch_dir.'/langstats/'.$orig_lang.'/'.$file, $file_string);
+ $global_var += $local_var;
};
$terms_diff = count($global_var) - count($terms_in_limit);
-echo count($global_var)." terms found in English files (summing up to $words_found words). Some terms ($terms_diff in this case) might have appeared in two different files
";
+echo count(
+ $global_var
+ )." terms found in English files (summing up to $words_found words). Some terms ($terms_diff in this case) might have appeared in two different files
";
/**
* Display results
*/
diff --git a/main/cron/user_import/get_data_from_mail.php b/main/cron/user_import/get_data_from_mail.php
index 68d6925481..1971c26190 100755
--- a/main/cron/user_import/get_data_from_mail.php
+++ b/main/cron/user_import/get_data_from_mail.php
@@ -20,16 +20,15 @@ require_once '../../inc/global.inc.php';
$users = Database::get_main_table(TABLE_MAIN_USER);
$string = '';
foreach ($list as $mail) {
- $mail = trim($mail);
- $sql = "SELECT user_id, official_code, firstname, lastname, email FROM $users WHERE email = '$mail'\n";
- $res = Database::query($sql);
- if ($res === false) { die(mysql_error()); }
- if (Database::num_rows($res) == 0) {
- $string .= 'No encontrado;'.$row['email'];
- } else {
- $row = Database::fetch_assoc($res);
- $string .= $row['user_id'].';'.$row['email'].';'.$row['firstname'].';'.$row['lastname'].';'.$row['official_code']."\r\n";
- }
+ $mail = trim($mail);
+ $sql = "SELECT user_id, official_code, firstname, lastname, email FROM $users WHERE email = '$mail'\n";
+ $res = Database::query($sql);
+ if (Database::num_rows($res) == 0) {
+ $string .= 'No encontrado;'.$row['email'];
+ } else {
+ $row = Database::fetch_assoc($res);
+ $string .= $row['user_id'].';'.$row['email'].';'.$row['firstname'].';'.$row['lastname'].';'.$row['official_code']."\r\n";
+ }
}
echo $string;
file_put_contents('/tmp/list.txt', $string);
diff --git a/main/inc/lib/search/search_widget.css b/main/inc/lib/search/search_widget.css
index 325ac09c45..2bc8212454 100755
--- a/main/inc/lib/search/search_widget.css
+++ b/main/inc/lib/search/search_widget.css
@@ -41,9 +41,6 @@
padding-right: 0.9em;
}
-
-
-
.doc_table {
width: 30%;
text-align: left;
@@ -81,7 +78,7 @@
}
#mode-selector {
width: 100px;
- padding: 4px;
+ padding: 4px;
top: 0px;
z-index: 9;
float:left;
diff --git a/main/mySpace/user_edit.php b/main/mySpace/user_edit.php
index 82e2023dd9..b79d72e4c8 100644
--- a/main/mySpace/user_edit.php
+++ b/main/mySpace/user_edit.php
@@ -76,15 +76,6 @@ $usernameInput->freeze();
// Password
$group = array();
$auth_sources = 0; //make available wider as we need it in case of form reset (see below)
-/*if (count($extAuthSource) > 0) {
- $group[] =& $form->createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
- $auth_sources = array();
- foreach ($extAuthSource as $key => $info) {
- $auth_sources[$key] = $key;
- }
- $group[] =& $form->createElement('select', 'auth_source', null, $auth_sources);
- $group[] =& $form->createElement('static', '', '', '
');
-}*/
$group[] = & $form->createElement('radio', 'password_auto', get_lang('Password'), get_lang('AutoGeneratePassword').'
', 1);
$group[] = & $form->createElement('radio', 'password_auto', 'id="radio_user_password"', null, 0);
$group[] = & $form->createElement('password', 'password', null, array('onkeydown' => 'javascript: password_switch_radio_button(document.user_add,"password[password_auto]");'));
@@ -109,24 +100,14 @@ $html_results_enabled[] = $form->addButtonUpdate(get_lang('Update'), 'submit', t
$form->addGroup($html_results_enabled);
// Validate form
if ($form->validate()) {
- $check = Security::check_token('post');
- if ($check) {
- $user = $form->exportValues();
- $email = $userInfo['email'];
+ $check = Security::check_token('post');
+ if ($check) {
+ $user = $form->exportValues();
+ $email = $userInfo['email'];
$username = $userInfo['username'];
- $send_mail = intval($user['mail']['send_mail']);
+ $send_mail = intval($user['mail']['send_mail']);
$auth_source = PLATFORM_AUTH_SOURCE;
-
$resetPassword = $user['password']['password_auto'] == '1' ? 0 : 2;
-
- if (count($extAuthSource) > 0 && $user['password']['password_auto'] == '2') {
- //$auth_source = $user['password']['auth_source'];
- //$password = 'PLACEHOLDER';
- } else {
- //$auth_source = PLATFORM_AUTH_SOURCE;
- //$password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
- }
-
$auth_source = $userInfo['auth_source'];
$password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
@@ -153,18 +134,18 @@ if ($form->validate()) {
$resetPassword
);
- if (!empty($email) && $send_mail) {
- $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('YourReg').' '.api_get_setting('siteName');
- $portal_url = api_get_path(WEB_PATH);
- if (api_is_multiple_url_enabled()) {
- $access_url_id = api_get_current_access_url_id();
- if ($access_url_id != -1) {
- $url = api_get_access_url($access_url_id);
- $portal_url = $url['url'];
- }
- }
-
- $emailbody = get_lang('Dear')." ".stripslashes(api_get_person_name($userInfo['firstname'], $userInfo['lastname'])).",\n\n".
+ if (!empty($email) && $send_mail) {
+ $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('YourReg').' '.api_get_setting('siteName');
+ $portal_url = api_get_path(WEB_PATH);
+ if (api_is_multiple_url_enabled()) {
+ $access_url_id = api_get_current_access_url_id();
+ if ($access_url_id != -1) {
+ $url = api_get_access_url($access_url_id);
+ $portal_url = $url['url'];
+ }
+ }
+
+ $emailbody = get_lang('Dear')." ".stripslashes(api_get_person_name($userInfo['firstname'], $userInfo['lastname'])).",\n\n".
get_lang('YouAreReg')." ".api_get_setting('siteName')." ".get_lang('WithTheFollowingSettings')."\n\n".
get_lang('Username')." : ".$username."\n".get_lang('Pass')." : ".stripslashes($password)."\n\n".
get_lang('Address')." ".api_get_setting('siteName')." ".
@@ -178,26 +159,26 @@ if ($form->validate()) {
get_lang('Email')." : ".api_get_setting('emailAdministrator');
$emailbody = nl2br($emailbody);
- api_mail_html(
+ api_mail_html(
api_get_person_name($userInfo['firstname'], $userInfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS),
$email,
$emailsubject,
$emailbody
);
- }
+ }
- Security::clear_token();
+ Security::clear_token();
$tok = Security::get_token();
header('Location: '.$url.'&message=1');
exit();
- }
+ }
} else {
- if (isset($_POST['submit'])) {
- Security::clear_token();
- }
- $token = Security::get_token();
- $form->addElement('hidden', 'sec_token');
- $form->setConstants(array('sec_token' => $token));
+ if (isset($_POST['submit'])) {
+ Security::clear_token();
+ }
+ $token = Security::get_token();
+ $form->addElement('hidden', 'sec_token');
+ $form->setConstants(array('sec_token' => $token));
}
$interbreadcrumb[] = array(
@@ -206,7 +187,7 @@ $interbreadcrumb[] = array(
);
if (isset($_REQUEST['message'])) {
- Display::addFlash(Display::return_message(get_lang('Updated'), 'normal'));
+ Display::addFlash(Display::return_message(get_lang('Updated'), 'normal'));
}
Display::display_header($tool_name);
diff --git a/main/webservices/user_import/service.php b/main/webservices/user_import/service.php
index 13a934f02e..826fccbcd9 100755
--- a/main/webservices/user_import/service.php
+++ b/main/webservices/user_import/service.php
@@ -14,8 +14,6 @@ require_once __DIR__.'/../../inc/global.inc.php';
*/
function import_users_from_file($filepath, $security_key)
{
- global $_configuration;
-
$errors_returned = array(
0 => 'success',
1 => 'file import does not exist',
@@ -24,8 +22,10 @@ function import_users_from_file($filepath, $security_key)
4 => 'security error'
);
+ $key = api_get_configuration_value('security_key');
+
// Check whether this script is launch by server and security key is ok.
- if (empty($_SERVER['REMOTE_ADDR']) || $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] || $security_key != $_configuration['security_key']) {
+ if (empty($_SERVER['REMOTE_ADDR']) || $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] || $security_key != $key) {
return $errors_returned[4];
}
diff --git a/plugin/courselegal/user_list.php b/plugin/courselegal/user_list.php
index f9ef111ace..eb1f243060 100755
--- a/plugin/courselegal/user_list.php
+++ b/plugin/courselegal/user_list.php
@@ -1,5 +1,6 @@
getUserAgreementList($courseId, $sessionId, $order);
$table = new HTML_Table(array('class' => 'data_table'));
@@ -69,15 +68,7 @@ if (!empty($userList)) {
$table->setCellContents($row, 1, $webDate);
$table->setCellContents($row, 2, $mailDate);
$table->setCellContents($row, 3, $link.' '.$deleteLink);
-
$row++;
-/*
- 'web_agreement' => string '1' (length=1)
- 'web_agreement_date' => string '2014-09-30 14:36:30' (length=19)
- 'mail_agreement' => string '1' (length=1)
- 'mail_agreement_date' => string '2014-09-30 14:43:16' (length=19)
- 'mail_agreement_link' => s*/
-
}
}
$url = $pluginPath.'start.php?'.api_get_cidreq();
diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseSelectForm.php b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseSelectForm.php
index 56e213e432..bb532eb4af 100644
--- a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseSelectForm.php
+++ b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseSelectForm.php
@@ -163,10 +163,10 @@ class CourseSelectForm
!empty($hidden_fields['destination_session']) &&
!empty($hidden_fields['origin_session'])
) {
- echo '';
- echo '';
- echo '';
- echo '';
+ echo '';
+ echo '';
+ echo '';
+ echo '';
}
$element_count = 0;
@@ -553,7 +553,7 @@ class CourseSelectForm
// Mark folders to import which are not selected by the user to import,
// but in which a document was selected.
$documents = isset($_POST['resource'][RESOURCE_DOCUMENT]) ? $_POST['resource'][RESOURCE_DOCUMENT] : null;
- if (!empty($resources) && is_array($resources))
+ if (!empty($resources) && is_array($resources)) {
foreach ($resources as $id => $obj) {
if (isset($obj->file_type) && $obj->file_type == 'folder' &&
!isset($_POST['resource'][RESOURCE_DOCUMENT][$id]) &&
@@ -575,6 +575,7 @@ class CourseSelectForm
}
}
}
+ }
// no break
default:
if (!empty($resources) && is_array($resources)) {
@@ -658,14 +659,11 @@ class CourseSelectForm
//get destination course title
if (!empty($hidden_fields['destination_course'])) {
+ $sessionTitle = null;
if (!empty($hidden_fields['destination_session'])) {
$sessionTitle = ' ('.api_get_session_name($hidden_fields['destination_session']).')';
- } else {
- $sessionTitle = null;
}
- $courseInfo = api_get_course_info(
- $hidden_fields['destination_course']
- );
+ $courseInfo = api_get_course_info($hidden_fields['destination_course']);
echo '