esclkm |
|
---|---|
we now have available are too few opportunities to hook code into page.edit
example: now: list ($ usr [ 'auth_read'], $ usr [ 'auth_write'], $ usr [ 'isadmin']) = sed_auth ( 'page', 'any');
sed_block ($ usr [ 'auth_read']);
$ id = sed_import ( 'id', 'G', 'INT');
$ c = sed_import ( 'c', 'G', 'TXT');
/ / Extra fields - getting
$ extrafields = array ();
$ fieldsres = sed_sql_query ( "SELECT * FROM $ db_extra_fields WHERE field_location = 'pages'");
while ($ row = sed_sql_fetchassoc ($ fieldsres)) $ extrafields [] = $ row;
if ($ a == 'update')
(
$ sql1 = sed_sql_query ( "SELECT page_cat, page_ownerid FROM $ db_pages WHERE page_id = '$ id' LIMIT 1");
Sed_die (sed_sql_numrows ($ sql1) == 0);
$ Row1 = sed_sql_fetcharray ($ sql1);
list ($ usr [ 'auth_read'], $ usr [ 'auth_write'], $ usr [ 'isadmin']) = sed_auth ( 'page', $ row1 [ 'page_cat']);
Sed_block ($ usr [ 'isadmin']);
/ * === Hook === * /
$ extp = sed_getextplugins ( 'page.edit.update.first');
If (is_array ($ extp))
(Foreach ($ extp as $ k => $ pl) (include_once ($ cfg [ 'plugins_dir'].'/'.$ pl [' pl_code'].'/'.$ pl [ 'pl_file'].'. php ');))
/ * ===== * /
list ($ usr [ 'auth_read'], $ usr [ 'auth_write'], $ usr [ 'isadmin']) = sed_auth ( 'page', 'any');
sed_block ($ usr [ 'auth_read']);
$ id = sed_import ( 'id', 'G', 'INT');
$ c = sed_import ( 'c', 'G', 'TXT');
/ / Extra fields - getting
$ extrafields = array ();
$ fieldsres = sed_sql_query ( "SELECT * FROM $ db_extra_fields WHERE field_location = 'pages'");
while ($ row = sed_sql_fetchassoc ($ fieldsres)) $ extrafields [] = $ row;
$ sql1 = sed_sql_query ( "SELECT page_cat, page_ownerid FROM $ db_pages WHERE page_id = '$ id' LIMIT 1");
Sed_die (sed_sql_numrows ($ sql1) == 0);
$ Row1 = sed_sql_fetcharray ($ sql1);
list ($ usr [ 'auth_read'], $ usr [ 'auth_write'], $ usr [ 'isadmin']) = sed_auth ( 'page', $ row1 [ 'page_cat']);
/ * === Hook === * /
$ Extp = sed_getextplugins ( 'page.edit.first');
If (is_array ($ extp))
(Foreach ($ extp as $ k => $ pl) (include_once ($ cfg [ 'plugins_dir'].'/'.$ pl [' pl_code'].'/'.$ pl [ 'pl_file'].'. php ');))
/ * ===== * /
if ($ a == 'update')
(
Sed_block ($ usr [ 'isadmin']);
analogical pages.add What do you think about this?[/][/] littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты |
Trustmaster |
|
---|---|
I think a hook before sed_block is really needed. This would eliminate duplicated code in things like eyoop. So I think we can just add the hook 'page.edit.first' and that will be fine.
May the Source be with you!
|
esclkm |
|
---|---|
on my place or other?
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты |
Trustmaster |
|
---|---|
Actually, this fix is not quite right for what you're going to do. What we need is to affect access privileges on a concrete item from within a plugin, an additional hook is just a dirty way to intercept the execution flow. There should be a better way to affect that auth check.
May the Source be with you!
|
esclkm |
|
---|---|
your ideas?
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты |
Trustmaster |
|
---|---|
Nothing brilliant at the moment, need to think it over later or see some other opinions in this topic.
May the Source be with you!
|
esclkm |
|
---|---|
Simple Idea! Trustmuster or Kilandor - say what do you think about it.
now:
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = sed_auth('page', $row1['page_cat']);
sed_block($usr['isadmin']);
/* === Hook === */
$extp = sed_getextplugins('page.edit.update.first');
if (is_array($extp))
{ foreach($extp as $k => $pl) { include_once($cfg['plugins_dir'].'/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } }
/* ===== */
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = sed_auth('page', $pag['page_cat']);
sed_block($usr['isadmin']);
/* === Hook === */
$extp = sed_getextplugins('page.edit.first');
if (is_array($extp))
{ foreach($extp as $k => $pl) { include_once($cfg['plugins_dir'].'/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } }
/* ===== */
I think better is:
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = sed_auth('page', $row1['page_cat']);
/* === Hook === */
$extp = sed_getextplugins('page.edit.update.first');
if (is_array($extp))
{ foreach($extp as $k => $pl) { include_once($cfg['plugins_dir'].'/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } }
/* ===== */
sed_block($usr['isadmin']);
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = sed_auth('page', $pag['page_cat']);
/* === Hook === */
$extp = sed_getextplugins('page.edit.first');
if (is_array($extp))
{ foreach($extp as $k => $pl) { include_once($cfg['plugins_dir'].'/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } }
/* ===== */
sed_block($usr['isadmin']);
What do you think about this? littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты |
Trustmaster |
|
---|---|
Yes, I approve this because currently there is no other way to overcome these limitations.
May the Source be with you!
|
esclkm |
|
---|---|
thx )
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты |