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

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