[development] problem rebuild-permissions

Lluís enboig at gmail.com
Fri Jun 13 12:23:39 UTC 2008


I have problems rebuilding my node_access table (too much nodes...).
Increasing my php execution time/memory limit is not an option so I
thougth of creating a script which updates one node at a time, and
using javascript loads to save the next node (I know making a module
with ajax would be more elegant, but not enough time...)
It basically recive a nid, load the node,
node_access_acquire_grants(), and refresh with the next node.

Should it work or it has some problem?

thanks

<?php
if ($_SERVER['REMOTE_ADDR']!='XXX.XXX.XXX.XXX') exit(); //ensure just
me can run this script
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
user_authenticate('admin', 'admin');
$actual=db_result(db_query("SELECT nid FROM {node} WHERE nid > %d
ORDER BY nid",$_GET['node']));
if ($actual>0) {
  $sencer=node_load($actual);
  node_access_acquire_grants($sencer);
}
?><html>
<head>
<script type="text/javascript">
<!--
function delayer(){
    window.location = "rebuild_permissions.php?node=<?=$actual?>"
}
//-->
</script>
</head>
<body <?=($actual>0 ? " onLoad=\"setTimeout('delayer()', 1000)\"" : "") ?>>
<?php
if ($actual>0) echo "doing...".$actual;
else echo "Done";
?>
</body>
</html>



-- 
*La felicitat ha de ser compatible, compartible i cooperativa.
*Envellim quan els records superen les esperances.
*Als llocs desconeguts només s'hi arriba per camins desconeguts.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.


More information about the development mailing list