Changeset 9314


Ignore:
Timestamp:
Feb 20, 2011, 1:01:10 AM (9 years ago)
Author:
patdenice
Message:

Another bugs... sorry...

Location:
extensions/AdditionalPages/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdditionalPages/admin/add_page.inc.php

    r9313 r9314  
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44
     5$default_user = get_default_user_info(true);
     6
    57if (!isset($edited_page))
    68{
    79  $page_title = l10n('ap_create');
    8   $default_user = get_default_user_info(true);
     10
    911  $edited_page = array(
    1012    'id'         => 0,
     
    5961  }
    6062
    61   $level_access = !empty($_POST['level']) ? $_POST['level'] : 'NULL';
     63  $level_access = !empty($_POST['level']) ? $_POST['level'] : $default_user['level'];
    6264
    6365  if (empty($page['errors']))
     
    98100);';
    99101      pwg_query($query);
    100       $edited_page['id'] = mysql_insert_id();
     102      $edited_page['id'] = pwg_db_insert_id(ADD_PAGES_TABLE, 'id');
    101103    }
    102104
     
    129131  $edited_page['groups'] = !empty($_POST['groups']) ? $_POST['groups'] : array();
    130132  $edited_page['users'] = !empty($_POST['users']) ? $_POST['users'] :  array();
    131   $edited_page['level'] = $_POST['level'];
     133  $edited_page['level'] = !empty($_POST['level']) ? $_POST['level'] :  $default_user['level'];
    132134  $edited_page['homepage'] = isset($_POST['homepage']);
    133135  $edited_page['standalone'] = isset($_POST['standalone']);
  • extensions/AdditionalPages/admin/config.inc.php

    r9310 r9314  
    1010  if (!$conf['additional_pages']['user_perm'] and isset($_POST['user_perm']))
    1111  {
    12     pwg_query('UPDATE '.ADD_PAGES_TABLE.' SET users = "guest,generic,normal" WHERE users IS NULL;');
     12    pwg_query('UPDATE '.ADD_PAGES_TABLE.' SET users = "guest,generic,normal,admin,webmaster";');
    1313  }
    1414  if ($conf['additional_pages']['user_perm'] and !isset($_POST['user_perm']))
     
    1818  if ($conf['additional_pages']['level_perm'] and !isset($_POST['level_perm']))
    1919  {
    20     pwg_query('UPDATE '.ADD_PAGES_TABLE.' SET level = 0;');
     20    $default_user = get_default_user_info(true);
     21    pwg_query('UPDATE '.ADD_PAGES_TABLE.' SET level = '.$default_user['level'].';');
    2122  }
    2223  if ($conf['additional_pages']['group_perm'] and !isset($_POST['group_perm']))
Note: See TracChangeset for help on using the changeset viewer.