phpPgAdmin - Login Fail - Virtual Class--cannot instantiate - phppgadmin

So I followed every step of the YouTube video on getting phpPgAdmin setup with XAMPP.
After I access localhost/phppgadmin using the credentials..
USERNAME: postgres
password: the password I created during setup..
I click login and I get ..
Virtual Class -- cannot instantiate
Having a hard time figuring this out, can someone please help me.
Thank you

I searched for the string "Virtual Class -- cannot instantiate" within all files in the folder and found it in the file "adodb.inc.php" (in my version it is on line 432):
/**
* Constructor
*/
function __construct()
{
die('Virtual Class -- cannot instantiate');
}
So I commented the line and phpPgAdmin started working again.
PS: it doesn't seem like the most appropriate way to fix the problem, but I needed it working soon

For people who are having problems in 2023 . #hericklr answer doenst is appropriate .
This is related with php ^8.0 versions !
Unfortunately for i see in the github phppgadmin page , the owner doesnt apply a update for long time .
So i made a fork updated : https://github.com/EdvaldoAFilho/pgAdmin
Just download and extract to : /usr/share/phppgadmin
(/usr/share/phppgadmin/[files])
Hope it works !

Related

TypeError: community.editProfile is not a function

this is my first time posting here and i am not really experienced in Node.js, but i found this kind of abandonned script on github which i needed for it. Basically what it should do is check for availability of a custom SteamID, and once its available it should claim it. It opens, but once the id is free i get this following error:
community.editProfile({
^
TypeError: community.editProfile is not a function
at setClaim (C:\Users\sam1e\Desktop\steam-turbo-master\terbowe.js:89:11)
The repo link is: https://github.com/wtfwtfwtf111/steam-turbo if anyone needs to take a look at it.
Thanks! :)

node populatedb url not working

I am learning ExpressJs tutorial from https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/mongoose
Now I have created module for mongodb database and then create a file populatedb.js in the root directory. Now I am trying to connect to database using command (as describe at last on above link)
node populatedb mongodb://dbuser:dbpassword#ds133814.mlab.com:33814/local_library_tutorial
but terminal response nothing and there doesn't happen in database
My Brother.
I ran into the same problem, and when my search led me to your question i was even more sad when I saw no answer, however after searching around, I found an answer!
Make sure you replace the "dbuser:dbpassword" placeholders with actual data e.g "Elias:js44889" on your mongo url.
Also just make sure it's also the same as the one in app.js.
I think all should be fine as it was for me.
you must include the script in populatedb.js to get work done.
populatedb.js script link : https://raw.githubusercontent.com/hamishwillee/express-locallibrary-tutorial/master/populatedb.js
After inserting the script in populatedb.js file from above link, then run the following commands to populate data in mongoDB.
npm install async (if not installed async module)
node populatedb <your mongodb url>
sometimes you may get an error if you use the same collection name in all of your models, this happened to me until i realised what i was doing was wrong.
for example don't do this
const authorModel = mongoose.model('author', AuthorSchema)
const bookModel = mongoose.model('author', BookSchema)
if you do it un-expeectedly it will throw this error
OverwriteModelError: Cannot overwrite author model once compiled.
instead in the commandline for "windows users" write
node populatedb mongodb+srv://username:password#yourcluster.mongodb.net/yourdatabase
and in your models make sure that the collections are not the same
const authorModel = mongoose.model('author', AuthorSchema)
const bookModel = mongoose.model('book', BookSchema)
I also ran into the same issue as I am doing the same tutorial. What I did to resolve this issue is go to the populatedb.js link they provide in the first step of the "Testing - create some items" or you can download it. Once I clicked on the link, they provide test data that you can paste into the populatedb.js file you've created in the root of your project then:
npm install async --save
node populatedb <your mongodb url>
Script should run and you should see the results or items as it creates them.
Followed the MDN tutorial, Here is what I fixed:
username:Jeff ; password : 12345
app.js, change to:
var mongoDB = 'mongodb://Jeff:123#ds149732.mlab.com:49732/local_library';
Command Line prompt, change to:
node populatedb mongodb://Jeff:12345#ds149732.mlab.com:49732/local_library
Posting here because this answer is the result I found googling the problem.
Had the same problem, the error ended up being the password I have set for the admin on the database - special characters were encoded (there was a warning displayed which I apparently ignored) which caused me to not be able to connect.
I had this issue for a couple of days with the error
zsh: no matches found: <my mongodb url>
First, I double checked I had followed the instructions in Testing — create some items in the tutorial.
Then I changed my original mongodb URL in the terminal, removing the end.
My original mongoURL =
mongodb+srv://username:password#cluster0.9f24o.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
My new mongoURL =
mongodb+srv://username:password#cluster0.9f24o.mongodb.net/myFirstDatabase
I ran this script while in my express-locallibrary tutorial folder.
node populatedb mongodb+srv://username:password#cluster0.9f24o.mongodb.net/myFirstDatabase
I'm not sure at this point if this means I need to change the link in app.js as well.
Hopefully this saves someone some time!

symfony2 get firewall name on login page

I'd want to use a login page to access different firewalls, so I need to get information about the firewall I'm logging in.
In my controller I'd use
$this->container->get('security.context')->getToken()->getProviderKey()
but as an anonymous user I don't have access to getProviderKey method.
I could also parse
_security.xxx.target_path
to get xxx firewall but I'm looking for a more general solution if it exists at all.
Any idea?
As of symfony 3.2, you can now get the current firewall configuration using the following:
public function indexAction(Request $request)
{
$firewall = $this->container
->get('security.firewall.map')
->getFirewallConfig($request)
->getName();
}
Ref: http://symfony.com/blog/new-in-symfony-3-2-firewall-config-class-and-profiler
For Symfony 3.4 I wrote this to avoid referencing the non-public "security.firewall.map" service:
$firewallName = null;
if (($firewallContext = trim($request->attributes->get("_firewall_context", null))) && (false !== ($firewallContextNameSplit = strrpos($firewallContext, ".")))) {
$firewallName = substr($firewallContext, $firewallContextNameSplit + 1);
}
(Referencing "security.firewall.map" on 3.4 will throw an exception.)
Edit: This will not work in a custom exception controller function.
I was doing a little research on this myself recently so that I could send this information in an XACML request as part of the environment.
As far as I can tell from GitHub issues like this one:
https://github.com/symfony/symfony/issues/14435
There is currently no way to reliably get the information out of Symfony except the dirty compiler pass hack suggested on the linked issue. It does appear from the conversation on these issues, they are working on making this available, however, the status is still open, so we will have to be patient and wait for it to be provided.
#Adambean's answer is pretty elegant, but I'd write it as a one-liner:
$firewallName = array_slice(explode('.', trim($request->attributes->get('_firewall_context'))), -1)[0];
The difference is that $firewallName will always be a string (which may be empty).
Also, please note that this answer (like #Adambean's) doesn't work for a firewall with a dot in its name.

Standalone PHP script using Expression Engine

Is there a way to make a script where I can do stuff like $this->EE->db (i.e. using Expression Engine's classes, for example to access the database), but that can be run in the command line?
I tried searching for it, but the docs don't seem to contain this information (please correct me if I'm wrong). I'm using EE 2.4 (the link above should point to 2.4 docs).
The following article seems to have a possible approach: Bootstrapping EE for CLI Access
Duplicate your index.php file and name it cli.php.
Move the index.php file outside your DOCUMENT_ROOT. Now, technically, this isn’t required, but there’s no reason for prying
eyes to see your hard work so why not protect it.
Inside cli.php update the $system_path on line 26 to point to your system folder.
Inside cli.php update the $routing['controller'] on line 96 to be cli.
Inside cli.php update the APPPATH on line 96 to be $system_path.'cli/'.
Duplicate the system/expressionengine directory and name it system/cli.
Duplicate the cli/controllers/ee.php file and name it cli/controllers/cli.php.
Finally, update the class name in cli/controllers/cli.php to be Cli and remove the methods.
By default EE calls the index method, so add in an index method to do what you need.
#Zenbuman This was useful as a starting point although I would add I had issues with all of my requests going to cli -> index, whereas I wanted some that went to cli->task1, cli->task2 etc
I had to update *system\codeigniter\system\core\URI.php*so that it knew how to extract the parameters I was passing via the command line, I got the code below from a more recent version of Codeigniter which supports the CLI
// Is the request coming from the command line?
if (php_sapi_name() == 'cli' or defined('STDIN'))
{
$this->_set_uri_string($this->_parse_cli_args());
return;
}
// Let's try the REQUEST_URI first, this will work in most situations
and also created the function in the same file
private function _parse_cli_args()
{
$args = array_slice($_SERVER['argv'], 1);
return $args ? '/' . implode('/', $args) : '';
}
Also had to comment out the following in my cli.php file as all routing was going to the index method in my cli controller and ignoring my parameters
/*
* ~ line 109 - 111 /cli.php
* ---------------------------------------------------------------
* Disable all routing, send everything to the frontend
* ---------------------------------------------------------------
*/
$routing['directory'] = '';
$routing['controller'] = 'cli';
//$routing['function'] = '';
Even leaving
$routing['function'] = '';
Will force requests to go to index controller
In the end I felt this was a bit hacky but I really need to use the EE API library in my case. Otherwise I would have just created a separate application with Codeigniter to handle my CLI needs, hope the above helps others.
I found #Zenbuman's answer after solving my own variation of this problem. My example allows you to keep the cron script inside a module, so if you need your module to have a cron feature it all stays neatly packaged together. Here's a detailed guide on my blog.

NetValidatePasswordPolicy issue on XP

My project has a requirement that it needs to check the password complexity before create the new account.
My code looks like:
NET_API_STATUS status;
NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG inputArg = {0};
NET_VALIDATE_OUTPUT_ARG* pOutputArg = NULL;
inputArg.ClearPassword = NewPass;
inputArg.PasswordMatch = TRUE;
status = NetValidatePasswordPolicy(DC, NULL, NetValidatePasswordChange,
&inputArg, (void**)&pOutputArg);
printf("status: %d, validationStatus: %d\n", status, pOutputArg->ValidationStatus);
NetValidatePasswordPolicyFree((void**)&pOutputArg);
I am working on windows XP.When I try to run, it prompt waring saying:
The procedure entry point NetValidPasswordPolicyFree could not be located in the dynamic link library NETAPI32.dll
From the MSDN it said the API is only valid in 2003 server and 2008 server.
Does it mean it can not work on XP?
Or can i find any other APIs to do the same thing as NetValidPasswordPolicy?
I googled a lot for this issue and found someone had asked similar question but it went unanswered :(. So, here I am trying my luck.
Even I tried to analyze 'NETAPI32.dll' in Reflector.exe, but while opening the .dll file it error out: Object reference not set to an instance of an object.
I am stuck badly and could not able to find any way. Any help will be appreciated :)
Issue has been solved :).
NetValidPasswordPolicy API from 'NETAPI32.dll' has requirements that it is not 'client' supported. Because of this requirement I am getting the warning: Entry point not found.
I tried my project on Windows 2003 server and it worked.
And my second question about 'Reflector.exe' is also invalid because 'NETAPI32.dll' is not .Net dll so Reflector wont recognize it.

Resources