LiveUser_Admin
[ class tree: LiveUser_Admin ] [ index: LiveUser_Admin ] [ all elements ]

Source for file test.php

Documentation is available at test.php

  1. <?php
  2.  
  3. require_once 'LiveUser/Admin.php';
  4.  
  5. $dsn 'mysql://root:@localhost/liveuser_admin_test';
  6.  
  7. $liveuserConfig = array(
  8.     'login' => array(
  9.         'force' => true,
  10.     ),
  11.     'authContainers' => array(
  12.         0 => array(
  13.             'type' => 'XML',
  14.             'file' => 'Auth_XML.xml',
  15.             'passwordEncryptionMode' => 'MD5'
  16.         ),
  17.     ),
  18.     'permContainer' => array(
  19.         'type'  => 'Medium',
  20.         'storage' => array('MDB2' => array('dsn' => $dsn'prefix'     => 'liveuser_')),
  21.     ),
  22. );
  23.  
  24. $lu =LiveUser_Admin::factory($liveuserConfig);
  25. $lu->setAdminContainers();
  26.  
  27. $params_rights = array(
  28.     'filters' => array(
  29.         'area_id' => 1,
  30.     ),
  31. );
  32.  
  33. $params_users = array(
  34.     'fields' => array(
  35.         'perm_user_id',
  36.         'perm_type',
  37.         'auth_container_name',
  38.     ),
  39.     'with' => array(
  40.         'perm_user_id' => array(
  41.             'fields' => array(
  42.                 'right_id',
  43.                 'right_level',
  44.                 'name',
  45.             ),
  46.         ),
  47.     ),
  48.     'filters' => array(
  49.         'perm_type' => 1,
  50.         'auth_container_name' => '0',
  51.     ),
  52.     'orders' => array(
  53.         'perm_type' => 'DESC',
  54.         'auth_user_id' => 'ASC',
  55.     ),
  56.     'limit' => 10,
  57.     'offset' => 0,
  58. );
  59.  
  60. $params_applications = array();
  61.  
  62. $params_areas = array();
  63.  
  64. $params_groups = array('filters' => array('perm_user_id' => '1'));
  65.  
  66. echo '<pre>';
  67. echo 'input';
  68. var_dump($params_rights);
  69. echo '<hr>';
  70. echo 'output';
  71. #var_dump($lu->perm->getRights($params_rights));
  72. echo '<hr>';
  73. echo 'underlying query:';
  74. var_dump($lu->perm->_storage->dbc->last_query);
  75. echo '<hr>';
  76. echo 'input';
  77. var_dump($params_users);
  78. echo '<hr>';
  79. echo 'output';
  80. #var_dump($lu->perm->getUsers($params_users));
  81. echo '<hr>';
  82. echo 'underlying query:';
  83. var_dump($lu->perm->_storage->dbc->last_query);
  84.  
  85. echo '<hr>';
  86. echo 'input';
  87. var_dump($params_applications);
  88. echo '<hr>';
  89. echo 'output';
  90. var_dump($lu->perm->getApplications($params_applications));
  91. echo '<hr>';
  92. echo 'underlying query:';
  93. var_dump($lu->perm->_storage->dbc->last_query);
  94.  
  95. echo '<hr>';
  96. echo 'input';
  97. var_dump($params_areas);
  98. echo '<hr>';
  99. echo 'output';
  100. var_dump($lu->perm->getAreas($params_areas));
  101. echo '<hr>';
  102. echo 'underlying query:';
  103. var_dump($lu->perm->_storage->dbc->last_query);
  104.  
  105. echo '<hr>';
  106. echo 'input';
  107. var_dump($params_groups);
  108. echo '<hr>';
  109. echo 'output';
  110. var_dump($lu->perm->getGroups($params_groups));
  111. echo '<hr>';
  112. echo 'underlying query:';
  113. var_dump($lu->perm->_storage->dbc->last_query);
  114. echo '</pre>';
  115. ?>

Documentation generated on Mon, 11 Mar 2019 14:29:03 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.