If you're on a custom plugin page, you have to export the user manually.
How to export the user on custom page in Osclass
View::newInstance()->_exportVariableToView("user", User::newInstance()->findByPrimaryKey($userId));
If you're in a controller,
$this->_exportVariableToView("user", User::newInstance()->findByPrimaryKey($userId));
Then, $userId
will depend on which user you refer to:
You can get it from the URL: use Params::getParam('userId')
and passing it as a GET parameter.
/index.php?page=custom&route=your_plugin_route&userId=12
Use the current logged user id: osc_logged_user_id()
See also
This tutorial on how to develop Osclass plugins, might be useful.