0

I'm trying to create my own moodle authentication plugin (/moodle/auth/manualspace/auth.php).

Inside it I want to call a function, but during execution an error message is displayed.

Can someone give a light?

Message error:

Exceção - Call to undefined function exibe_msg()

Code:

public function exibe_msg() {
   echo "
   <html>
   <title>Problem</title>
   <body>
   <h1>You're not allowed...</h2>
   </body>
   </html>";
}

function user_authenticated_hook($user, $username, $password)  {
    global $CFG;

    exibe_msg();

    require_logout();   

   exit(0);

}

Thanks in advance

Roberto

2 Answers2

0

Can you Show us the whole class ?

It must Look Like this https://github.com/catalyst/moodle-auth_basic/blob/master/auth.php

and then the function call must look like this :

$this->exibe_msg();
BlackNetworkBit
  • 768
  • 11
  • 21
0

public function means it is inside class and not abstract, so you have to instantiate your class first