#include <dpl/wrt-dao-ro/WrtDatabase.h>
namespace WrtDB {
-void GlobalDAO::SetSecureByDefault(bool secure)
-{
- //If secure == true -> widget does not need to be signed
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- GlobalProperties::Row row;
- row.Set_secure_by_default(secure);
- WRT_DB_UPDATE(update, GlobalProperties, &WrtDatabase::interface())
- update->Values(row);
- update->Execute();
- }
- Catch(DPL::DB::SqlConnection::Exception::Base) {
- ReThrowMsg(GlobalDAO::Exception::DatabaseError,
- "Failed to update secureByDefault");
- }
-}
-
void GlobalDAO::SetRoamingDataUsage(GlobalDAO::NetworkAccessMode newMode)
{
LogDebug("updating roaming network data usage to:" << newMode);
#include <dpl/wrt-dao-ro/common_dao_types.h>
namespace WrtDB {
-
-bool GlobalDAOReadOnly::GetSecureByDefault()
-{
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface())
- return select->GetSingleValue<GlobalProperties::secure_by_default>();
-}
-
GlobalDAOReadOnly::NetworkAccessMode GlobalDAOReadOnly::GetRoamingDataUsage()
{
LogDebug("Getting roaming network data usage");
public:
- static bool GetSecureByDefault() DPL_DEPRECATED;
static bool GetCookieSharingMode() DPL_DEPRECATED;
class GlobalDAO : public GlobalDAOReadOnly
{
public:
- static void SetSecureByDefault(bool secureByDefault) DPL_DEPRECATED;
-
/**
* This method changes network access mode while roaming is enabled.
*
PRAGMA foreign_keys = ON;
BEGIN TRANSACTION;
)
-/*TODO: secure_by_default should be 0 by default*/
CREATE_TABLE(GlobalProperties)
- COLUMN_NOT_NULL(secure_by_default, INT, DEFAULT 1)
COLUMN_NOT_NULL(roaming_data_usage, TINYINT, DEFAULT 1)
COLUMN_NOT_NULL(cookie_sharing_mode, INT, DEFAULT 0)
CREATE_TABLE_END()