| version 1.7, 2007/09/02 20:44:41 |
version 1.8, 2010/09/24 15:52:18 |
| Line 14 $ezin_admin_bindings_triggers = array( / |
|
| Line 14 $ezin_admin_bindings_triggers = array( / |
|
| * ezin_admin_bindings_main() |
* ezin_admin_bindings_main() |
| */ |
*/ |
| |
|
| function ezin_admin_bindings_main($perm_articles, $perm_sections) /* {{{ */ |
function ezin_admin_bindings_main($perm_articles, $perm_sections, $perm_authors) /* {{{ */ |
| { |
{ |
| global $ezin_sys; |
global $ezin_sys; |
| global $ezin_cfg; |
global $ezin_cfg; |
| Line 24 function ezin_admin_bindings_main($perm_ |
|
| Line 24 function ezin_admin_bindings_main($perm_ |
|
| 'article_bind_theme' => strstr($perm_articles, 'a'), |
'article_bind_theme' => strstr($perm_articles, 'a'), |
| 'article_bind_lang' => strstr($perm_articles, 'a'), |
'article_bind_lang' => strstr($perm_articles, 'a'), |
| 'page_bind_lang' => strstr($perm_articles, 'a'), |
'page_bind_lang' => strstr($perm_articles, 'a'), |
| 'section_bind_lang' => strstr($perm_sections, 's')); |
'section_bind_lang' => strstr($perm_sections, 's'), |
| |
'author_bind' => strstr($perm_authors, 't')); |
| |
|
| $op_change = array( |
$op_change = array( |
| 'article_bind_theme' => strstr($perm_articles, 'A'), |
'article_bind_theme' => strstr($perm_articles, 'A'), |
| 'article_bind_lang' => strstr($perm_articles, 'A'), |
'article_bind_lang' => strstr($perm_articles, 'A'), |
| 'page_bind_lang' => strstr($perm_articles, 'A'), |
'page_bind_lang' => strstr($perm_articles, 'A'), |
| 'section_bind_lang' => strstr($perm_sections, 'S')); |
'section_bind_lang' => strstr($perm_sections, 'S'), |
| |
'author_bind' => strstr($perm_authors, 'T')); |
| |
|
| echo '<form class="pme-form" method="post">',"\n"; |
echo '<form class="pme-form" method="post">',"\n"; |
| |
|
| Line 42 function ezin_admin_bindings_main($perm_ |
|
| Line 44 function ezin_admin_bindings_main($perm_ |
|
| $type = 'page_bind_lang'; |
$type = 'page_bind_lang'; |
| } elseif (isset($_POST['section_bind_lang'])) { |
} elseif (isset($_POST['section_bind_lang'])) { |
| $type = 'section_bind_lang'; |
$type = 'section_bind_lang'; |
| |
} elseif (isset($_POST['author_bind'])) { |
| |
$type = 'author_bind'; |
| } else { |
} else { |
| $action = ''; |
$action = ''; |
| isset($_POST['bind_remove']) && $action = 'remove'; |
isset($_POST['bind_remove']) && $action = 'remove'; |
| Line 102 function ezin_admin_bindings_main($perm_ |
|
| Line 106 function ezin_admin_bindings_main($perm_ |
|
| .' FROM '.$ezin_sys['db']['tables']['sections'] |
.' FROM '.$ezin_sys['db']['tables']['sections'] |
| .' ORDER BY IFNULL(bind,0) ASC, ord ASC, id ASC'; |
.' ORDER BY IFNULL(bind,0) ASC, ord ASC, id ASC'; |
| break; |
break; |
| |
case 'author_bind': |
| |
$query = 'SELECT name, access_key AS name2, template_key AS name3,' |
| |
.' id, bind' |
| |
.' FROM '.$ezin_sys['db']['tables']['authors'] |
| |
.' ORDER BY IFNULL(bind,0) ASC, id ASC'; |
| |
break; |
| default: |
default: |
| return false; |
return false; |
| } |
} |
| Line 194 function ezin_admin_bindings_buttons($f_ |
|
| Line 204 function ezin_admin_bindings_buttons($f_ |
|
| $op_list['section_bind_lang'] && print('<input'.$d.' class="pme-sections" type="submit" name="section_bind_lang" value="Sections"> '); |
$op_list['section_bind_lang'] && print('<input'.$d.' class="pme-sections" type="submit" name="section_bind_lang" value="Sections"> '); |
| $op_list['article_bind_lang'] && print('<input'.$d.' class="pme-articles" type="submit" name="article_bind_lang" value="Articles"> '); |
$op_list['article_bind_lang'] && print('<input'.$d.' class="pme-articles" type="submit" name="article_bind_lang" value="Articles"> '); |
| $op_list['article_bind_lang'] && print('<input'.$d.' class="pme-pages" type="submit" name="page_bind_lang" value="Pages"> '); |
$op_list['article_bind_lang'] && print('<input'.$d.' class="pme-pages" type="submit" name="page_bind_lang" value="Pages"> '); |
| |
$op_list['author_bind'] && print('<input'.$d.' class="pme-authors" type="submit" name="author_bind" value="Authors"> '); |
| $op_list['article_bind_lang'] && print('<input'. ' class="pme-themes" type="submit" name="article_bind_theme" value="Themes">'); |
$op_list['article_bind_lang'] && print('<input'. ' class="pme-themes" type="submit" name="article_bind_theme" value="Themes">'); |
| echo '</td>',"\n",'<td class="pme-buttons2">',"\n"; |
echo '</td>',"\n",'<td class="pme-buttons2">',"\n"; |
| // $f_change = 1; // DEBUG |
// $f_change = 1; // DEBUG |
| Line 226 function ezin_admin_bindings_save($type, |
|
| Line 237 function ezin_admin_bindings_save($type, |
|
| |
|
| $update_value = 0; |
$update_value = 0; |
| $update_field = $type == 'article_bind_theme' ? 'bind_theme' : 'bind_lang'; |
$update_field = $type == 'article_bind_theme' ? 'bind_theme' : 'bind_lang'; |
| |
$update_field = $type == 'author_bind' ? 'bind' : $update_field; |
| $update_table = $type == 'section_bind_lang' |
$update_table = $type == 'section_bind_lang' |
| ? $ezin_sys['db']['tables']['sections'] |
? $ezin_sys['db']['tables']['sections'] |
| : $ezin_sys['db']['tables']['articles']; |
: $ezin_sys['db']['tables']['articles']; |
| |
$update_table = $type == 'author_bind' |
| |
? $ezin_sys['db']['tables']['authors'] |
| |
: $update_table; |
| if ($action == 'create') { |
if ($action == 'create') { |
| if (count($ar_bind) > 0) { |
if (count($ar_bind) > 0) { |
| sort($ar_bind); |
sort($ar_bind); |
| Line 293 function ezin_admin_bindings_save($type, |
|
| Line 308 function ezin_admin_bindings_save($type, |
|
| |
|
| $ezin_perm_articles = ''; |
$ezin_perm_articles = ''; |
| $ezin_perm_sections = ''; |
$ezin_perm_sections = ''; |
| |
$ezin_perm_authors = ''; |
| ezin_admin_check_full_list_privileges($ezin_user['role_articles']) && $ezin_perm_articles .= 'a'; |
ezin_admin_check_full_list_privileges($ezin_user['role_articles']) && $ezin_perm_articles .= 'a'; |
| ezin_admin_check_full_list_privileges($ezin_user['role_sections']) && $ezin_perm_sections .= 's'; |
ezin_admin_check_full_list_privileges($ezin_user['role_sections']) && $ezin_perm_sections .= 's'; |
| |
ezin_admin_check_full_list_privileges($ezin_user['role_authors']) && $ezin_perm_authors .= 't'; |
| strstr($ezin_perm_articles, 'a') && stristr($ezin_user['role_articles'], 'C') && $ezin_perm_articles .= 'A'; |
strstr($ezin_perm_articles, 'a') && stristr($ezin_user['role_articles'], 'C') && $ezin_perm_articles .= 'A'; |
| strstr($ezin_perm_sections, 's') && stristr($ezin_user['role_sections'], 'C') && $ezin_perm_sections .= 'S'; |
strstr($ezin_perm_sections, 's') && stristr($ezin_user['role_sections'], 'C') && $ezin_perm_sections .= 'S'; |
| |
strstr($ezin_perm_authors, 't') && stristr($ezin_user['role_authors'], 'C') && $ezin_perm_authors .= 'T'; |
| |
|
| if (strlen($ezin_perm_articles) > 0 || strlen($ezin_perm_sections) > 0) { |
if (strlen($ezin_perm_articles) > 0 || strlen($ezin_perm_sections) > 0 || strlen($ezin_perm_authors) > 0) { |
| ezin_check_db_handle(); |
ezin_check_db_handle(); |
| ezin_admin_bindings_main($ezin_perm_articles, $ezin_perm_sections); |
ezin_admin_bindings_main($ezin_perm_articles, $ezin_perm_sections, $ezin_perm_authors); |
| ezin_close_db_connection(); |
ezin_close_db_connection(); |
| } else { |
} else { |
| require 'inc-html/permdenied.html'; |
require 'inc-html/permdenied.html'; |