Moodle: Hide "Your site is not yet registered" message - moodle

I am on Moodle 3.10 on IIS. I am trying to hide the message that popups: "Your site is not yet registered".
I once edited a php and commented it out, but since a recent upgrade I lost it and it is back. I don't remember which file or area I updated to hide this.

Go to the file moodle/admin/search.php
Then find and comment the line echo $adminrenderer->warn_if_not_registered();, the line number should be 56.
The end result should look like this.
53 // Display a warning if site is not registered.
54 if (empty($query)) {
55 $adminrenderer = $PAGE->get_renderer('core', 'admin');
56 //echo $adminrenderer->warn_if_not_registered();
57 }

Related

CommandBar / RibbonBar issue with Outlook 2016 and VB6

I am trying to revive / recompile an old Outlook Plugin that was written in VB6 however I am getting an error seemingly related to setting a button on the Ribbon bar. Just cannot work out why and would appreciate any feedback / guidance.
The Plugin still works fine on Outlook 2003 on Windows 7 for both x86 and x64
The issue though is trying to recompile it so I can tweak it and also have it run with the more recent versions of Outlook name 2013 - 2018
In compiling I am getting - Error in loading DLL for xxxx.CommandBars ( Lines 40 and I presume also 70 )
Public Function CreateTSEButton() As Boolean
10 On Error GoTo CreateTSEButton_Error
20 If Not objExplorer Is Nothing Then
Dim mCommandBar As CommandBar
30 On Error Resume Next
40 Set mCommandBar = objExplorer.CommandBars("E-mail")
50 On Error GoTo 0
60 If mCommandBar Is Nothing Then
70 Set mCommandBar = objExplorer.CommandBars("Standard")
80 End If
90 If mCommandBar Is Nothing Then Exit Function
'Command Bar Initialized, Now Find the Control First
Dim mControl As Object
100 For Each mControl In mCommandBar.Controls
110 If UCase$(Trim$(TypeName(mControl))) = UCase$(Trim$("CommandBarButton")) Then
120 If UCase$(Trim$(mControl.Caption)) = UCase$(Trim$(IDS_TSE_ON)) Or UCase$(Trim$(mControl.Caption)) = UCase$(Trim$(IDS_TSE_OFF)) Then
'Button Found
130 Set mTSEButton = mControl
140 Exit For
150 End If
160 End If
170 Next
180 If Not mTSEButton Is Nothing Then
190 Call UpdateButtonStatus
200 Else
210 Set mTSEButton = mCommandBar.Controls.add(msoControlButton, , , , True)
220 mTSEButton.Style = msoButtonIconAndCaption
230 mTSEButton.BeginGroup = True
240 mTSEButton.Enabled = True
250 mTSEButton.Visible = True
260 Call UpdateButtonStatus
270 End If
280 Set mControl = Nothing
290 Set mCommandBar = Nothing
300 End If
310 Exit Function
CreateTSEButton_Error:
Definitions ;
Private WithEvents objOLApp As Outlook.Application
Private WithEvents colInspectors As Outlook.Inspectors
Private WithEvents objExplorer As Outlook.Explorer
Private WithEvents mTSEButton As Office.CommandBarButton
References (image grab);
screen grab of the references list
I have done a lot of hunting around and a bunch of reading and from what I have seen Microsoft moved to a XML type model along the lines of CodeJock if that name rings a bell.
The code in the plugin is solid, I just cannot compile it due to the above error which if having to guess relates to the new XML format that should be used for 2013 onwards ?
I do have a couple of other VB6 apps here that use CodeJock for the Ribbon bar so they are self contained and work fine in VB6 so I can see what goes on there.
However tapping into Outlook and from the VB6 code and adding / interacting with a button in the Outlook Command bar or Ribbon bar as I think it is now called is not working for me.
My questions (or requests for help) fall around the following ( I'm not very clued up on Outlook interfacing );
a) has "Outlook.Explorer" been replaced with something else so it is just a matter of using what the new whatever is ?
b) I have read about IDTExtensibility2 but not sure how that factors in if at all
c) Do I actually have to rewrite the code completely for placing button on the Ribbon Bar / Command Bar of Outlook 2013 + and if so could you point me to an example please for VB6 and Outlook 2013 or 2016 etc as I am having trouble finding anything.
I would prefer not to have to rewrite this VB6 code in VB.Net if I can help it.
Thanks
Note that there is no way to load a 32-bit DLL into a 64-bit process (and vice versa).
I'm pretty sure VB 6.0 runtime files are 32-bit. So your Outlook 2016 should be 32-bit as well. The reason it works okay with Outlook 2003 is because Outlook 2003 is a 32-bit application.
A possible solution would be either (1) or (2) as listed below:
rebuild this plugin under VB.Net to get 64-bit binary
use 32-bit version of Outlook 2013 - 2016
You need to rewrite your code that accesses the command bars in Outlook with XML based ribbons. You'd be better off creating a new VSTO addin in VB.Net - that will let you use the built-in Ribbon designer.
See https://learn.microsoft.com/en-us/visualstudio/vsto/walkthrough-creating-your-first-vsto-add-in-for-outlook?view=vs-2019

How do I display specific error messages

Full Code - Pastebin.com
I am attempting to refine my PowerShell script by adding in error messages if they appear.
I am planning for
If a Username already exists in our AD environment
If the "NewUsername" text box is left blank
these are just the first 2 examples I can see causing a problem going forward.
I have been researching around, and I believe i should be using try/catch blocks. However I am unsure of how to incorporate them, and how to pull specific error messages.
Do I do start that by adding the try/catch blocks at this location in the code?
$CreateAccount = New-Object system.windows.Forms.Button
$CreateAccount.Text = "Create Account"
$CreateAccount.Width = 127
$CreateAccount.Height = 27
$CreateAccount.Add_MouseClick({
#add here code triggered by the event
try
{
#code to actually run here
}
catch
{
#code to display error messages if any come up
}
If so, can someone point me in the right direction to grab the 2 error types so I can display them to the user running the script?
I feel I must also point out that I convert the .ps1 script to an .exe file with no console showing when it is ran. Will this cause issues for that?

Tikiwiki version 15.3 There is no email sent when user setup forum thread watch

I am using tiki version 15.3
I setup my preference that if there is a new forum thread that I am an editor, I will receive an email notification in "My Watches". However, I haven't received any email. It works for blog and new user registration though. So no problem with the email setup. As I debug the code, I found a few problem in the code:
In File: /lib/notification/notificationemaillib.php
Line: 112
$nots_raw = $tikilib->get_event_watches($event, $event == 'forum_post_topic'? $forum_info['forumId']: $threadId, $forum_info);
Should the $threadId is the $parentId? Since the Tiki_user_Watch table store the Thread Parent Id not the newly created threadId.
Secondly,
In line 122:
foreach ( $nots_raw as $n ) {
if ($n['user'] != $author
&& !in_array($n['user'], $users)) {
// make sure user receive only one notification even if he is monitoring both the topic and thread
$n['language'] = $tikilib->get_user_preference($n['user'], "language", $defaultLanguage);
$nots[] = $n;
$users[] = $n['user'];
}
There is no else for this if clause. I understand this condition is to send only 1 email when user monitor both thread and topic. However, I am monitoring only 1 of them, I think there should be an"
else{ $nots[] = $n;}
This way the $nots will have something to send email in the later part of the code.
if (count($nots)) {
include_once('lib/webmail/tikimaillib.php');
$smarty->assign('mail_forum', $forum_info["name"]);...
Please advise if I am wrong.
You are correct. I believe I have fixed it with this commit, which will be in the next release of version 15 (also committed to version 16, 17 and trunk).
The parent ID needed to be used instead of the thread ID as you pointed out (thanks for that - made it much easier with most of the debugging already done!). There was also an issue with identifying the existing watches properly. I don't think the if statement needs an else, but let me know if this doesn't fix it for you.

Authentication error in moodle when entering administration logins

Every time I enter my administration username and password, I get this error message:
Fatal error: Maximum execution time of 30 seconds exceeded in /home/gosmartm/public_html/moodle/mod/quiz/lang/en/quiz.php on line 870
The file and line are different every time; I've updated the execution time to 120s but still get the same problem.
Can someone help me?
Thank you in advance
Can you switch debugging on and report the result - edit /config.php and add these 2 lines after $CFG = new stdClass();
$CFG->debug = 32767;
$CFG->debugdisplay = true;
If you can report the full php trace, not just the last line - it's unlikely a language file is causing the time out, its probably something happening before that.

Perl/Swig/Python/Postgresql/C++ Script just stops executing, only getting "Premature end of script headers"

This is hard to explain in a few sentences. I have spent the last 5 days trying to figure this out, so now I'm asking here as a last resort. I am trying to run a pool physics library with tournament server, built by the Stanford University Computational Billiards Group, available at http://www.stanford.edu/group/billiards/
It provides a tournament server using apache2, postgresql and perl. I have been able to enable functions like logging in or creating simple matches, but the communication with AI clients does not work. The client is a C++ application I'm running in a terminal, its fetching commands from the server and its printing this error:
XMLRPC error: Unable to transport XML to server and get XML response back. HTTP response code is 500, not 200
And the apache2 error.log is printing this:
[Thu May 17 21:30:17 2012] [error] [client 127.0.0.1] Premature end of script headers: api.pl
I tried running it with CGI::Debug but didnt get any more output. I have been able to identify the line it fails at with some debug outputs (one after every line :) ) and it's in this function, on the line between the print STDERRs:
package Pool::Rules::GameState;
sub addToDb {
my $self=shift;
my $timeleft=shift || $self->timeLeft();
my $timeleft_opp=shift || $self->timeLeftOpp();
#print STDERR "uh uh uh".$self." ".$self->timeLeft()." ".$self->timeLeftOpp()." ".$timeleft." ".$timeleft_opp."\n";
my $playingSolids = ($self->isOpenTable() ? undef : ($self->playingSolids()?1:0));
# print STDERR "addToDb: X".$self->isOpenTable()."X Y".$self->playingSolids()."Y Z".$playingSolids."Z\n";
$Pool::dB::dbh->do('INSERT INTO states (turntype,cur_player_started,playing_solids,timeleft,timeleft_opp,gametype) VALUES (?,?,?,?,?,?)',{},
$self->getTurnType(),$self->curPlayerStarted()?1:0,$playingSolids,$timeleft,$timeleft_opp,$self->gameType()) or STDERR $DBI::errstr;
my $stateid=$Pool::dB::dbh->selectrow_array('SELECT lastval()');
$self->tableState()->addToDb($stateid);
return $stateid;
}
It's only simple getter-methods. And still, it just stops executing. The code of the getter-methods has been generated by swig. The first print-line prints this:
uh uh uhPool::Rules::GameState=HASH(0x99fa99c) 0 0 00:10:00 00:10:00
Which seems to be okay, just curious that the $self->-getters only print 0. Since the library is from Stanford University and actual competitions have been held with it, I find it hard to believe that this is an error in the code. It just seems to be a bit too old to work (I had to make some adjustments on other places to make it work on more recent versions of libraries, f.ex. I added a < cstddef >-include in another file unrelated to this perl-issue). I first tried making it run on current versions, which I failed. Then I tried to install it on the versions the readme.txt sais it's been tested for (Ubuntu 8.10, Perl 5.10 and so on), but at some point my Ubuntu 8.10 installation always died and I had to reinstall (I tried this ~4 times, the gnome-terminal always Segmentation faulted). So now I'm back in Ubuntu 12 trying to make it work. I dont know much about perl, only the little I have been able to pick up over the last few days trying to get this to run.
Does anyone have an idea what could be triggering this kind of behavior? Is anyone aware of any compatibility issues that may be related to this? If you need any additional information just ask and I'll provide it.
Thank you for your help!