C# Class mybox.OwnCloudDB

Server side database to store user accounts
Inheritance: IServerDB
Show file Open project: jonocodes/mybox

Public Methods

Method Description
CheckPassword ( String pwordOrig, String pwordHashed ) : bool
Connect ( String connectionString, String baseDataDir ) : void
GetDataDir ( ServerUser user ) : String
GetFileListSerializable ( ServerUser user ) : List>

Gets the file list in a manner that is easy to serialize and send.

GetUserByName ( String userName ) : ServerUser

Get an account from the database via a known ID

OwnCloudDB ( ) : System

Initializes a new instance of the mybox.OwnCloudDB class.

RemoveFile ( ServerUser user, String filePath ) : bool

Removes the file entry from the database.

ShowUsers ( ) : void

Print a list of the accounts in the database

UpdateFile ( ServerUser user, MyFile thisFile ) : bool

Update or insert a new entry for the file into the database

UsersCount ( ) : int

Get the number of entries in the accounts table

Method Details

CheckPassword() public method

public CheckPassword ( String pwordOrig, String pwordHashed ) : bool
pwordOrig String
pwordHashed String
return bool

Connect() public method

public Connect ( String connectionString, String baseDataDir ) : void
connectionString String
baseDataDir String
return void

GetDataDir() public method

public GetDataDir ( ServerUser user ) : String
user ServerUser
return String

GetFileListSerializable() public method

Gets the file list in a manner that is easy to serialize and send.
public GetFileListSerializable ( ServerUser user ) : List>
user ServerUser /// This account. ///
return List>

GetUserByName() public method

Get an account from the database via a known ID
public GetUserByName ( String userName ) : ServerUser
userName String
return ServerUser

OwnCloudDB() public method

Initializes a new instance of the mybox.OwnCloudDB class.
public OwnCloudDB ( ) : System
return System

RemoveFile() public method

Removes the file entry from the database.
public RemoveFile ( ServerUser user, String filePath ) : bool
user ServerUser
filePath String
return bool

ShowUsers() public method

Print a list of the accounts in the database
public ShowUsers ( ) : void
return void

UpdateFile() public method

Update or insert a new entry for the file into the database
public UpdateFile ( ServerUser user, MyFile thisFile ) : bool
user ServerUser
thisFile MyFile
return bool

UsersCount() public method

Get the number of entries in the accounts table
public UsersCount ( ) : int
return int