* check if the login button is pressed and logg the user in
*
*/
- public static function loginlisener(){
+ public static function loginLisener(){
if(isset($_POST['loginbutton']) and isset($_POST['password']) and isset($_POST['login'])){
if(OC_USER::login($_POST['login'],$_POST['password'])){
echo 1;
* try to create a new user
*
*/
- public static function createuser($username,$password){
+ public static function createUser($username,$password){
global $CONFIG_DBTABLEPREFIX;
if(OC_USER::getuserid($username,true)!=0){
return false;
* check if the logout button is pressed and logout the user
*
*/
- public static function logoutlisener(){
+ public static function logoutLisener(){
if(isset($_GET['logoutbutton']) && isset($_SESSION['username'])){
OC_LOG::event($_SESSION['username'],2,'');
$_SESSION['user_id']=false;
* try to create a new group
*
*/
- public static function creategroup($groupname){
+ public static function createGroup($groupname){
global $CONFIG_DBTABLEPREFIX;
if(OC_USER::getgroupid($groupname,true)==0){
$groupname=OC_DB::escape($groupname);
* get the id of a user
*
*/
- public static function getuserid($username,$nocache=false){
+ public static function getUserId($username,$nocache=false){
global $CONFIG_DBTABLEPREFIX;
$usernameclean=strtolower($username);
if(!$nocache and isset($_SESSION['user_id_cache'][$usernameclean])){//try to use cached value to save an sql query
* get the id of a group
*
*/
- public static function getgroupid($groupname,$nocache=false){
+ public static function getGroupId($groupname,$nocache=false){
global $CONFIG_DBTABLEPREFIX;
if(!$nocache and isset($_SESSION['group_id_cache'][$groupname])){//try to use cached value to save an sql query
return $_SESSION['group_id_cache'][$groupname];
* get the name of a group
*
*/
- public static function getgroupname($groupid,$nocache=false){
+ public static function getGroupName($groupid,$nocache=false){
global $CONFIG_DBTABLEPREFIX;
if($nocache and $name=array_search($groupid,$_SESSION['group_id_cache'])){//try to use cached value to save an sql query
return $name;
* check if a user belongs to a group
*
*/
- public static function ingroup($username,$groupname){
+ public static function inGroup($username,$groupname){
global $CONFIG_DBTABLEPREFIX;
$userid=OC_USER::getuserid($username);
* add a user to a group
*
*/
- public static function addtogroup($username,$groupname){
+ public static function addToGroup($username,$groupname){
global $CONFIG_DBTABLEPREFIX;
if(!OC_USER::ingroup($username,$groupname)){
}
}
- public static function generatepassword(){
+ public static function generatePassword(){
return uniqid();
}
* get all groups the user belongs to
*
*/
- public static function getusergroups($username){
+ public static function getUserGroups($username){
global $CONFIG_DBTABLEPREFIX;
$userid=OC_USER::getuserid($username);
* set the password of a user
*
*/
- public static function setpassword($username,$password){
+ public static function setPassword($username,$password){
global $CONFIG_DBTABLEPREFIX;
$password=sha1($password);
* check the password of a user
*
*/
- public static function checkpassword($username,$password){
+ public static function checkPassword($username,$password){
global $CONFIG_DBTABLEPREFIX;
$password=sha1($password);