[svn r22381] logic changes-improvements in "terms & conditions" - (FS#4320)

skala
Isaac Flores 17 years ago
parent 3d6e7ff521
commit e4138e2a7b
  1. 2
      main/admin/legal_add.php
  2. 5
      main/inc/lib/legal.lib.php
  3. 4
      main/inc/lib/main_api.lib.php

@ -108,7 +108,7 @@ if (isset($_POST['language'])) {
//$form->addElement('html_editor', 'content', null, null, array('ToolbarSet' => 'Basic', 'Width' => '100%', 'Height' => '250'));
$form->addElement('static', $_POST['language']);
$form->addElement('hidden', 'language',$_POST['language']);
$form->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'simple', 'Width' => '65%', 'Height' => '250'));
$form->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'simple', 'Width' => '100%', 'Height' => '250'));
//$form->addElement('textarea', 'content', get_lang('Content'),array('cols'=>'120','rows'=>'10'));
$form->addElement('radio', 'type', '', get_lang('HTMLText') ,'0');
$form->addElement('radio', 'type', '', get_lang('PageLink') ,'1');

@ -4,9 +4,12 @@
*/
class LegalManager
{
private function __construct() {
//void
}
function add($language, $content, $type, $changes) {
$legal_table = Database::get_main_table(TABLE_MAIN_LEGAL);
$last = LegalManager::get_last_condition($language);
$last = self::get_last_condition($language);
$language = Database::escape_string($language);
$content = Database::escape_string($content);
$type = intval($type);

@ -3757,6 +3757,10 @@ function api_check_term_condition($user_id) {
require_once api_get_path(LIBRARY_PATH).'legal.lib.php';
$t_uf = Database::get_main_table(TABLE_MAIN_USER_FIELD);
$t_ufv = Database::get_main_table(TABLE_MAIN_USER_FIELD_VALUES);
//check if exists terms and conditions
if (LegalManager::count()==0) {
return true;
}
//check the last user version_id passed
$sqlv = "SELECT field_value FROM $t_ufv ufv inner join $t_uf uf on ufv.field_id= uf.id
WHERE field_variable = 'legal_accept' AND user_id = ".intval($user_id);

Loading…
Cancel
Save