$current_user = wp_get_current_user();
$roles = $current_user->roles;
$pass = "no";
foreach ($roles as $key => $value) {
if($value == "my_courses_admin"){
$pass = "yes";
break;
}
}
if($pass == "yes"){
add_menu_page('View', 'Data View', 'read', __FILE__, 'mt_toplevel_page');
}
public function createApacheHtaccessFile(){
$fileName = ".htaccess";
$filePath = $_SERVER['DOCUMENT_ROOT'].'/'.'sites/default/files/log';
$handle = opendir( $filePath );
if( $handle ){
$fl = fopen( $filePath."/".$fileName, "a");
fwrite($fl, "deny from all");
fclose($fl);
}
else{
$isCreatedDir = @mkdir( $filePath );
if( $isCreatedDir ){
$fl = fopen( $filePath."/".$fileName, "a");
fwrite($fl, "deny from all");
fclose($fl);
}
else{
echo "It is not possible to create directory!";
exit;
}
}
}
//create zip file from 30 log files and remove them
function createArchive(){
$size = $this->archieve_count;
$zip = new ZipArchive();
$filePath = $_SERVER['DOCUMENT_ROOT'].'/'.'sites/default/files/log';
$zipFileName = $filePath.DIRECTORY_SEPARATOR.strftime("log_archieve_"."%d_%m_%Y_(%H-%M-%S)".".zip");
if ( $zip->open( $zipFileName, ZipArchive::CREATE ) !== TRUE )
{
throw new Exception("Cannot create zip archieve");
}
for($i = 0; $i < $size; $i++){
if (file_exists($filename = $filePath.DIRECTORY_SEPARATOR."log_".($i+1))) {
$zip->addFile( $filename );
}
}
$zip->close();
if( file_exists($zipFileName) ){
for($i = 0; $i < $size; $i++){
if($this->isFileExists($filePath.DIRECTORY_SEPARATOR."log_".($i+1)))
unlink( $filePath.DIRECTORY_SEPARATOR."log_".($i+1) );
}
}
}
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
...
NLS_NCHAR_CHARACTERSET AL16UTF16