Fix, session list order and limit conditions - refs BT#9092

1.10.x
Daniel Barreto 11 years ago
parent 8b776c45c6
commit eee5eee90f
  1. 15
      plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.php

@ -852,22 +852,19 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
/**
* List all session (id, name) for select input
* @param int $length
* @param int $limit
* @return array
*/
public function listAllSessions($length = 100)
public function listAllSessions($limit = 100)
{
$length = intval($length);
$limit = intval($limit);
$sessionTable = Database::get_main_table(TABLE_MAIN_SESSION);
$columns = 'id, name';
$conditions = array();
if ($length > 0) {
if ($limit > 0) {
$conditions = array(
'order' => array(
'BY name LIMIT ?' => array(
$length
)
)
'order' => 'name',
'limit' => $limit,
);
}

Loading…
Cancel
Save