Changeset 9854


Ignore:
Timestamp:
Mar 25, 2011, 6:15:08 PM (10 years ago)
Author:
Eric
Message:

merging r9827, r9846 and r9853 from trunk to branch 2.20

Location:
extensions/NBC_UserAdvManager/branches/2.20
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/branches/2.20/include/functions.inc.php

    r9382 r9854  
    1919    array(
    2020      'NAME' => $name,
    21       'URL'  => get_admin_plugin_menu_link(UAM_PATH.'/admin/UAM_admin.php')
     21      'URL' => get_root_url().'admin.php?page=plugin-'.basename(UAM_PATH)
    2222    )
    2323  );
  • extensions/NBC_UserAdvManager/branches/2.20/include/upgradedb.inc.php

    r9267 r9854  
    1111{
    1212  define('UAM_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
    13 }
    14 if (!defined('UAM_ROOT'))
    15 {
    16   define('UAM_ROOT', dirname(__FILE__).'/');
    1713}
    1814
     
    358354LIMIT 1
    359355;';
    360  
    361   pwg_query($query);
     356
     357  pwg_query($query);
     358
     359  // Create new UAM entry in plugins table
     360  $query = '
     361INSERT INTO '.PLUGINS_TABLE.' (id, state, version)
     362VALUES ("UserAdvManager","active","'.$uam_new_version.'")
     363;';
     364 
     365  pwg_query($query);
     366
     367  // Delete old plugin entry in plugins table
     368  $query = '
     369DELETE FROM '.PLUGINS_TABLE.'
     370WHERE id="NBC_UserAdvManager"
     371LIMIT 1
     372;';
     373 
     374  pwg_query($query);
     375
     376  // rename directory
     377  if (!rename(PHPWG_PLUGINS_PATH.'NBC_UserAdvManager', PHPWG_PLUGINS_PATH.'UserAdvManager'))
     378  {
     379    die('Fatal error on plugin upgrade process : Unable to rename directory ! Please, rename manualy the plugin directory name from ../plugins/NBC_UserAdvManager to ../plugins/UserAdvManager.');
     380  }
    362381}
    363382?>
  • extensions/NBC_UserAdvManager/branches/2.20/main.inc.php

    r9296 r9854  
    22/*
    33Plugin Name: UserAdvManager
    4 Version: 2.20.0-RC
     4Version: 2.20.0-RC3
    55Description: Renforcer la gestion des utilisateurs - Enforce users management
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=216
     
    1717
    1818if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    19 if (!defined('UAM_DIR')) define('UAM_DIR' , basename(dirname(__FILE__)));
    2019if (!defined('UAM_PATH')) define('UAM_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
    2120
  • extensions/NBC_UserAdvManager/branches/2.20/maintain.inc.php

    r9254 r9854  
    44{
    55  define('UAM_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
    6 }
    7 if (!defined('UAM_ROOT'))
    8 {
    9   define('UAM_ROOT', dirname(__FILE__).'/');
    106}
    117
     
    2824The admin of the gallery.','false','false','false','false','false','Sorry [username], your account has been deleted due to a too long time passed since your last visit at [mygallery].','Sorry [username], your account has been deprecated due to a too long time passed since your last visit at [mygallery]. Please, use the following link to revalidate your account.',-1,-1,'Thank you for registering at [mygallery]. Your account has been manually validated by _admin_. You may now log in at _link_to_site_ and make any appropriate changes to your profile. Welcome to _name_of_site_!','false','You have requested a password reset on our gallery. Please, find below your new connection settings.','false','Sorry, your account has been deleted because you have not validated your registration in requested time. Please, try registration with a valid and non blocked email account.','false');
    2925
    30   $q = '
     26        $query = '
     27SELECT param
     28  FROM '.CONFIG_TABLE.'
     29WHERE param = "UserAdvManager"
     30;';
     31  $count = pwg_db_num_rows(pwg_query($query));
     32 
     33  if ($count == 0)
     34  {
     35    $q = '
    3136INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    3237VALUES ("UserAdvManager","'.addslashes(serialize($default1)).'","UAM parameters")
    3338  ;';
    34   pwg_query($q);
     39    pwg_query($q);
     40  }
    3541
    3642
     
    4551Note: After this period, your account will be permanently deleted.','You have confirmed that you are human and may now use [mygallery]! Welcome [username]!','Your activation key is incorrect or expired or you have already validated your account, please contact the webmaster to fix this problem.');
    4652
    47   $q = '
     53        $query = '
     54SELECT param
     55  FROM '.CONFIG_TABLE.'
     56WHERE param = "UserAdvManager_ConfirmMail"
     57;';
     58  $count = pwg_db_num_rows(pwg_query($query));
     59 
     60  if ($count == 0)
     61  {
     62    $q = '
    4863INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    4964VALUES ("UserAdvManager_ConfirmMail","'.addslashes(serialize($default2)).'","UAM ConfirmMail parameters")
    5065  ;';
    51   pwg_query($q);
    52  
    53   $q = '
     66    pwg_query($q);
     67  }
     68
     69        $query = '
     70SELECT param
     71  FROM '.CONFIG_TABLE.'
     72WHERE param = "UserAdvManager_Redir"
     73;';
     74  $count = pwg_db_num_rows(pwg_query($query));
     75 
     76  if ($count == 0)
     77  {
     78    $q = '
    5479INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    5580VALUES ("UserAdvManager_Redir","0","UAM Redirections")
    5681  ;';
    57   pwg_query($q);
     82    pwg_query($q);
     83  }
     84
     85// Set current plugin version in config table
     86  $plugin =  PluginInfos(UAM_PATH);
     87  $version = $plugin['version'];
     88
     89        $query = '
     90SELECT param
     91  FROM '.CONFIG_TABLE.'
     92WHERE param = "UserAdvManager_Redir"
     93;';
     94  $count = pwg_db_num_rows(pwg_query($query));
     95 
     96  if ($count == 0)
     97  {
     98    $q = '
     99INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
     100VALUES ("UserAdvManager_Version","'.$version.'","UAM version check")
     101  ;';
     102    pwg_query($q);
     103  }
    58104
    59105
Note: See TracChangeset for help on using the changeset viewer.