本文整理汇总了PHP中ACL::initializeFromRow方法的典型用法代码示例。如果您正苦于以下问题:PHP ACL::initializeFromRow方法的具体用法?PHP ACL::initializeFromRow怎么用?PHP ACL::initializeFromRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACL
的用法示例。
在下文中一共展示了ACL::initializeFromRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectByPath
function selectByPath($path)
{
$dbq = new DB();
$dbq->db_connect();
$query = "SELECT acl_id, user_id, sage_acl.path_id, delete_path, write_path, read_path,\n rename_path, delete_file, write_file, read_file, rename_file, sage_path.pathname\n FROM sage_acl, sage_path\n WHERE sage_acl.path_id = sage_path.path_id\r\n AND sage_path.pathname = '{$path}'";
$acls = $dbq->db_select($query);
for ($i = 0; $i < count($acls); $i++) {
$acl = new ACL();
$acl->initializeFromRow($acls[$i]);
$this->list[] = $acl;
}
return true;
}
示例2: getACLByPath
function getACLByPath($path)
{
$retacl = new ACL();
if ($this->is_su == "1") {
$retacl->acl_id = 1;
$retacl->delete_path = "1";
$retacl->write_path = "1";
$retacl->read_path = "1";
$retacl->rename_path = "1";
$retacl->delete_file = "1";
$retacl->write_file = "1";
$retacl->read_file = "1";
$retacl->rename_file = "1";
return $retacl;
}
$done = false;
$acllist = new ACLList();
$curacls = array();
$currentUserId = $this->user_id;
while (!$done) {
$currentUser = new User();
if (!$currentUser->selectById($currentUserId)) {
$done = true;
} else {
if ($acllist->selectByUserIdAndPath($currentUser->user_id, $path)) {
$curacls = $acllist->list;
}
if (count($curacls) == 0) {
$currentUserId = $currentUser->user_id_parent;
} else {
$done = true;
$retacl->initializeFromRow($curacls[0]);
}
}
}
return $retacl;
}